:root {
  color-scheme: light;
  --bg: #f7fafc;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-soft: rgba(244, 248, 252, 0.92);
  --ink: #16202a;
  --muted: #687586;
  --subtle: #8b98a8;
  --line: rgba(91, 111, 132, 0.14);
  --line-strong: rgba(55, 137, 255, 0.24);
  --blue: #2f7df6;
  --blue-deep: #1556cf;
  --cyan: #32c5ff;
  --aqua: #20d6bd;
  --green: #36c786;
  --orange: #ff9854;
  --pink: #f46cae;
  --violet: #8876ff;
  --danger: #ef5b5b;
  --blue-soft: rgba(47, 125, 246, 0.12);
  --cyan-soft: rgba(50, 197, 255, 0.14);
  --aqua-soft: rgba(32, 214, 189, 0.14);
  --orange-soft: rgba(255, 152, 84, 0.16);
  --pink-soft: rgba(244, 108, 174, 0.14);
  --shadow: 0 18px 46px rgba(39, 78, 118, 0.12);
  --shadow-soft: 0 10px 28px rgba(52, 94, 133, 0.08);
  --blur: saturate(160%) blur(18px);
  --radius: 18px;
  --radius-small: 12px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 8%, rgba(50, 197, 255, 0.34), transparent 30%),
    radial-gradient(circle at 88% 4%, rgba(136, 118, 255, 0.22), transparent 28%),
    radial-gradient(circle at 72% 92%, rgba(32, 214, 189, 0.22), transparent 34%),
    linear-gradient(145deg, #fbfdff 0%, #f5f9ff 42%, #eef7fb 100%);
  color: var(--ink);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.38) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.52), transparent 78%);
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 470px) 1fr;
  gap: 28px;
  padding: 28px;
}

.login-panel,
.login-aside-inner,
.sidebar,
.topbar,
.panel,
.kpi,
.table-wrap,
.modal,
.org-card,
.permission-item,
.user-card {
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.login-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 30px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 30px;
}

.login-brand h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  font-weight: 850;
  color: var(--ink);
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

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

.field span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 720;
}

.input,
.select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 0 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.input:focus,
.select:focus {
  border-color: rgba(47, 125, 246, 0.56);
  box-shadow: 0 0 0 5px rgba(47, 125, 246, 0.12);
}

.input[readonly] {
  background: rgba(239, 245, 251, 0.78);
  color: var(--muted);
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 760;
  box-shadow: var(--shadow-soft);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(47, 125, 246, 0.13);
}

.btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--blue-deep), var(--cyan));
}

.btn.ghost {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.66);
}

.btn.danger {
  color: var(--danger);
  background: rgba(239, 91, 91, 0.12);
}

.section-title {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 780;
}

.ui-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: -4px;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.brand h1,
.topbar h2,
.nav button,
.kpi span,
.panel-head h3,
.permission-item b,
.org-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .ui-icon,
.topbar .ui-icon {
  color: var(--blue);
}

.nav button .ui-icon {
  width: 16px;
  height: 16px;
}

.nav button.active .ui-icon {
  color: #fff;
}

.kpi .ui-icon,
.panel-head .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--blue);
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.auth-switch button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 760;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.auth-switch button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.auth-note {
  margin: -2px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
}

.login-aside {
  display: grid;
  align-content: center;
  min-width: 0;
}

.login-aside-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 34px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.permission-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.permission-item {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 18px;
  min-height: 138px;
  box-shadow: var(--shadow-soft);
}

.permission-item:nth-child(1) {
  background:
    linear-gradient(145deg, rgba(47, 125, 246, 0.16), rgba(255, 255, 255, 0.66)),
    var(--surface);
}

.permission-item:nth-child(2) {
  background:
    linear-gradient(145deg, rgba(32, 214, 189, 0.16), rgba(255, 255, 255, 0.66)),
    var(--surface);
}

.permission-item:nth-child(3) {
  background:
    linear-gradient(145deg, rgba(255, 152, 84, 0.18), rgba(255, 255, 255, 0.66)),
    var(--surface);
}

.permission-item b {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 18px;
}

.permission-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 18px;
  padding: 18px;
}

.sidebar {
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  box-shadow: var(--shadow);
}

.brand {
  padding: 12px 10px 4px;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 860;
  color: var(--ink);
}

.brand p {
  margin: 7px 0 0;
  color: var(--subtle);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  border-radius: 18px;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 760;
}

.nav button.active {
  background: linear-gradient(135deg, rgba(47, 125, 246, 0.18), rgba(50, 197, 255, 0.16));
  color: var(--blue-deep);
  box-shadow: inset 0 0 0 1px rgba(47, 125, 246, 0.08);
}

.nav button:not(.active):hover {
  background: rgba(255, 255, 255, 0.62);
}

.user-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.user-card strong {
  font-size: 14px;
}

.user-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.62);
  position: sticky;
  top: 18px;
  z-index: 10;
  box-shadow: var(--shadow-soft);
}

.topbar h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.1;
  font-weight: 860;
  color: var(--ink);
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-button {
  position: relative;
  width: 42px;
  padding: 0;
}

.offline-sync-button {
  min-width: 104px;
  color: #176b4d;
  border-color: rgba(54, 199, 134, 0.28) !important;
  background: rgba(54, 199, 134, 0.1) !important;
  white-space: nowrap;
}

.offline-sync-button .ui-icon {
  color: #176b4d;
}

.offline-sync-button.has-error {
  color: #b42318;
  border-color: rgba(239, 91, 91, 0.32) !important;
  background: rgba(239, 91, 91, 0.11) !important;
}

.offline-sync-button.has-error .ui-icon {
  color: #b42318;
}

.notification-button b {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.top-actions .select {
  min-width: 168px;
}

.content {
  display: grid;
  gap: 16px;
}

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

.kpi-grid-dashboard {
  align-items: stretch;
}

.kpi {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 26px;
  padding: 18px;
  min-height: 132px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-soft);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.kpi:nth-child(1) {
  background:
    radial-gradient(circle at 82% 12%, rgba(50, 197, 255, 0.38), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(224, 241, 255, 0.78));
}

.kpi:nth-child(2) {
  background:
    radial-gradient(circle at 84% 16%, rgba(136, 118, 255, 0.3), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(236, 232, 255, 0.76));
}

.kpi:nth-child(3) {
  background:
    radial-gradient(circle at 84% 16%, rgba(32, 214, 189, 0.3), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(223, 250, 244, 0.76));
}

.kpi:nth-child(4) {
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 152, 84, 0.34), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 239, 225, 0.78));
}

.kpi::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.54);
}

.kpi-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.kpi strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 860;
  position: relative;
  z-index: 1;
}

.kpi small {
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.kpi em {
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #b42318;
  background: rgba(239, 91, 91, 0.12);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-style: normal;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi.is-alert {
  border-color: rgba(239, 91, 91, 0.46);
  box-shadow: 0 18px 42px rgba(239, 91, 91, 0.14), var(--shadow-soft);
}

.kpi.is-alert.severity-medium,
.kpi.is-alert.severity-low {
  border-color: rgba(255, 152, 84, 0.42);
  box-shadow: 0 18px 42px rgba(255, 152, 84, 0.12), var(--shadow-soft);
}

.kpi.is-alert.severity-medium em,
.kpi.is-alert.severity-low em {
  color: #9a4b13;
  background: rgba(255, 152, 84, 0.13);
}

.kpi-ring {
  width: 54px;
  height: 54px;
  position: relative;
  z-index: 1;
  transform: rotate(-90deg);
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}

.ring-track {
  stroke: rgba(76, 95, 117, 0.12);
}

.ring-value {
  stroke: var(--blue);
}

.kpi-aqua .ring-value,
.metric-aqua .ring-value {
  stroke: var(--aqua);
}

.kpi-orange .ring-value,
.metric-orange .ring-value {
  stroke: var(--orange);
}

.kpi-violet .ring-value {
  stroke: var(--violet);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 14px;
}

.dashboard-grid-3 {
  grid-template-columns: minmax(300px, 0.9fr) minmax(280px, 0.8fr) minmax(280px, 0.8fr);
}

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

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

.comparison-card {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  align-content: center;
  gap: 7px;
}

.comparison-card span,
.comparison-card small {
  color: var(--subtle);
  font-size: 12px;
}

.comparison-card b {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.comparison-card.up b {
  color: var(--green);
}

.comparison-card.down b {
  color: var(--danger);
}

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

.branch-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
}

.branch-stat-card {
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52)),
    linear-gradient(135deg, var(--blue-soft), transparent 58%);
  display: grid;
  gap: 13px;
}

.branch-stat-card.is-clickable,
.daily-trend-card.is-clickable {
  cursor: pointer;
}

.branch-stat-card.is-clickable:focus,
.daily-trend-card.is-clickable:focus {
  outline: 3px solid rgba(84, 122, 255, 0.22);
  outline-offset: 2px;
}

.branch-card-action {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--blue-deep);
  background: rgba(84, 122, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  font-size: 12px;
  font-weight: 820;
}

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

.branch-card-head span,
.branch-sales-focus span,
.branch-metric-grid span {
  color: var(--subtle);
  font-size: 12px;
}

.branch-card-head h4 {
  margin: 3px 0 0;
  font-size: 18px;
  color: var(--ink);
}

.branch-card-head b {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
}

.branch-sales-focus {
  display: grid;
  gap: 8px;
}

.branch-sales-focus strong {
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.branch-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(76, 95, 117, 0.1);
  overflow: hidden;
}

.branch-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--aqua));
}

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

.branch-metric-grid div {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  align-content: space-between;
}

.branch-metric-grid b {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.daily-trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 12px;
}

.daily-trend-card {
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.56)),
    linear-gradient(135deg, rgba(32, 214, 189, 0.12), transparent 64%);
  display: grid;
  gap: 13px;
}

.daily-trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.daily-trend-head span,
.daily-today-focus span,
.daily-today-focus small,
.daily-trend-metrics span {
  color: var(--subtle);
  font-size: 12px;
}

.daily-trend-head h4 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 22px;
}

.daily-trend-head b {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--aqua-soft);
  color: #118a7b;
  display: inline-flex;
  align-items: center;
  font-weight: 760;
  font-size: 12px;
}

.daily-trend-body {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) minmax(0, 0.58fr);
  align-items: end;
  gap: 12px;
}

.daily-today-focus {
  display: grid;
  gap: 6px;
}

.daily-today-focus strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.daily-sparkline {
  width: 100%;
  min-height: 82px;
  overflow: visible;
}

.daily-spark-area {
  fill: rgba(47, 125, 246, 0.12);
}

.daily-spark-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.daily-spark-dot {
  fill: #fff;
  stroke: var(--aqua);
  stroke-width: 3;
}

.daily-trend-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.daily-trend-metrics div {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  align-content: space-between;
}

.daily-trend-metrics b {
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.panel {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 26px;
  padding: 16px;
  min-width: 0;
  box-shadow: var(--shadow-soft);
}

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

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
  font-weight: 820;
}

.panel-head span {
  color: var(--subtle);
  font-size: 12px;
}

.panel-head-actions,
.modal-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.daily-chart {
  min-height: 248px;
}

.trend-chart {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.trend-chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(76, 95, 117, 0.12);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--subtle);
  font-size: 11px;
}

.sales-area {
  fill: url("#salesAreaGradient");
  pointer-events: none;
}

.sales-line,
.spend-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.sales-line {
  stroke: url("#salesLineGradient");
}

.spend-line {
  stroke: url("#spendLineGradient");
  stroke-width: 3;
  stroke-dasharray: 2 8;
}

.sales-dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 3;
}

.spend-dot {
  fill: #fff;
  stroke: var(--orange);
  stroke-width: 2.5;
  opacity: 0;
}

.chart-hover-point {
  outline: none;
}

.chart-hit-area {
  fill: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.chart-crosshair {
  stroke: rgba(76, 95, 117, 0.18);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  opacity: 0;
}

.chart-tooltip {
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 14px 24px rgba(42, 64, 110, 0.16));
  transition: opacity 160ms ease;
}

.chart-tooltip rect {
  fill: rgba(255, 255, 255, 0.94);
  stroke: rgba(134, 152, 185, 0.22);
}

.chart-tooltip text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.chart-tooltip .chart-tooltip-title {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 860;
}

.chart-hover-point:hover .chart-tooltip,
.chart-hover-point:focus .chart-tooltip,
.chart-hover-point:hover .chart-crosshair,
.chart-hover-point:focus .chart-crosshair,
.chart-hover-point:hover .spend-dot,
.chart-hover-point:focus .spend-dot {
  opacity: 1;
}

.chart-hover-point:hover .sales-dot,
.chart-hover-point:focus .sales-dot {
  stroke-width: 4;
}

.chart-hover-point:focus .chart-hit-area {
  stroke: rgba(84, 122, 255, 0.22);
  stroke-width: 2;
}

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

.chart-summary div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.chart-summary b,
.chart-summary span {
  display: block;
}

.chart-summary b {
  color: var(--ink);
  font-size: 18px;
}

.chart-summary span {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 12px;
}

.funnel {
  display: grid;
  gap: 15px;
}

.funnel-row {
  display: grid;
  gap: 8px;
}

.funnel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.funnel-meta b {
  font-size: 13px;
}

.funnel-meta span {
  color: var(--subtle);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.funnel-track {
  height: 18px;
  border-radius: 999px;
  background: rgba(76, 95, 117, 0.09);
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--aqua));
  box-shadow: 0 6px 18px rgba(47, 125, 246, 0.18);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: 154px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), var(--shadow-soft);
  position: relative;
}

.donut::before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut div {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.donut b {
  font-size: 24px;
  color: var(--ink);
}

.donut span {
  color: var(--subtle);
  font-size: 12px;
}

.donut-legend {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.legend-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend-row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
}

.legend-1 {
  background: var(--aqua);
}

.legend-2 {
  background: var(--orange);
}

.metric-rings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-ring {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
}

.metric-ring svg {
  width: 76px;
  height: 76px;
  transform: rotate(-90deg);
}

.metric-ring b {
  color: var(--ink);
  font-size: 17px;
}

.metric-ring span {
  color: var(--subtle);
  font-size: 12px;
}

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

.count-tile {
  min-height: 92px;
  padding: 13px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  display: grid;
  align-content: space-between;
}

.count-tile span,
.count-tile small {
  color: var(--subtle);
  font-size: 12px;
}

.count-tile b {
  font-size: 24px;
  color: var(--ink);
}

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

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

.rank-row b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.rank-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(76, 95, 117, 0.1);
  margin-top: 7px;
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--aqua));
  border-radius: inherit;
}

.rank-row span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.rank-panel {
  overflow: hidden;
}

.rank-podium {
  min-height: 228px;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.08fr) minmax(0, 0.88fr);
  gap: 14px;
  align-items: end;
  padding: 12px 6px 18px;
}

.podium-card {
  position: relative;
  min-width: 0;
  min-height: 154px;
  border: 1px solid rgba(178, 193, 214, 0.48);
  border-radius: 12px;
  padding: 18px 12px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 249, 253, 0.66));
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  text-align: center;
  box-shadow: 0 12px 26px rgba(37, 68, 110, 0.08);
}

.podium-gold {
  min-height: 186px;
  padding-top: 18px;
  background:
    linear-gradient(180deg, rgba(255, 250, 226, 0.96), rgba(255, 255, 255, 0.72)),
    linear-gradient(135deg, rgba(255, 206, 74, 0.18), transparent 68%);
  transform: translateY(-10px);
}

.podium-silver {
  background:
    linear-gradient(180deg, rgba(242, 247, 252, 0.94), rgba(255, 255, 255, 0.7)),
    linear-gradient(135deg, rgba(159, 174, 190, 0.14), transparent 64%);
}

.podium-bronze {
  background:
    linear-gradient(180deg, rgba(255, 239, 225, 0.92), rgba(255, 255, 255, 0.68)),
    linear-gradient(135deg, rgba(220, 133, 65, 0.14), transparent 64%);
}

.podium-empty {
  min-height: 110px;
  opacity: 0.34;
}

.podium-card b {
  max-width: 100%;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-card strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.podium-gold strong {
  font-size: 30px;
}

.medal {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f7c84a;
  border: 6px solid #ffe089;
  color: #a76600;
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.28),
    0 10px 18px rgba(151, 101, 13, 0.16);
}

.podium-gold .medal {
  width: 70px;
  height: 70px;
  border-width: 7px;
}

.podium-silver .medal {
  background: #c9d3dc;
  border-color: #e6edf3;
  color: #6a7885;
}

.podium-bronze .medal {
  background: #d99155;
  border-color: #f3b879;
  color: #80420d;
}

.medal span {
  position: relative;
  z-index: 2;
  font-size: 24px;
  font-weight: 920;
}

.podium-gold .medal span {
  font-size: 30px;
}

.medal i,
.medal i::before,
.medal i::after {
  position: absolute;
  content: "";
  display: block;
}

.medal i {
  display: none;
  left: 50%;
  bottom: -27px;
  width: 30px;
  height: 28px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(196, 117, 24, 0.9), rgba(238, 165, 72, 0.9));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
  z-index: -1;
}

.podium-silver .medal i {
  background: linear-gradient(90deg, rgba(122, 138, 153, 0.88), rgba(196, 207, 217, 0.9));
}

.podium-bronze .medal i {
  background: linear-gradient(90deg, rgba(159, 86, 30, 0.9), rgba(221, 142, 73, 0.9));
}

.rank-table {
  border: 1px solid rgba(178, 193, 214, 0.48);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.62);
}

.rank-table-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(178, 193, 214, 0.32);
}

.rank-table-row:last-child {
  border-bottom: 0;
}

.rank-table-row:nth-child(even) {
  background: rgba(246, 249, 253, 0.7);
}

.rank-table-row span {
  color: var(--muted);
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.rank-table-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.rank-table-row strong {
  color: var(--muted);
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px 160px auto;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.compact-table {
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

caption,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 120;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--blue-deep);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

.skip-link:focus,
.skip-link:focus-visible,
.skip-link.is-visible {
  transform: translateY(0) !important;
}

:where(button, input, select, textarea, [role="button"], .kpi, .podium-card, .rank-table-row):focus-visible {
  outline: 3px solid rgba(84, 122, 255, 0.34);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(84, 122, 255, 0.12);
}

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

th {
  color: var(--muted);
  background: rgba(247, 250, 252, 0.96);
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 780;
}

tbody tr:hover td {
  background: rgba(47, 125, 246, 0.055);
}

.record-row-alert td {
  background: rgba(255, 152, 84, 0.045);
}

.record-row-alert td:first-child {
  box-shadow: inset 3px 0 0 rgba(255, 152, 84, 0.72);
}

.record-alert-tags {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 5px;
}

.record-alert-tag {
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
  background: rgba(255, 152, 84, 0.12);
  color: #a45a18;
}

.record-alert-tag.severity-high {
  background: rgba(239, 91, 91, 0.12);
  color: #a92f3f;
}

.record-alert-tag.severity-low {
  background: rgba(50, 197, 255, 0.12);
  color: #126c92;
}

.record-quality-bar {
  padding: 10px 12px;
  border: 1px solid rgba(255, 152, 84, 0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.82), rgba(255, 255, 255, 0.7));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.record-quality-bar.severity-high {
  border-color: rgba(239, 91, 91, 0.26);
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.84), rgba(255, 255, 255, 0.72));
}

.record-quality-bar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.record-quality-bar b {
  color: var(--ink);
  font-size: 13px;
}

.record-quality-bar span {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.35;
}

.record-quality-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.record-quality-counts span {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-weight: 840;
  white-space: nowrap;
}

.record-quality-counts .severity-high {
  color: #a92f3f;
  background: rgba(239, 91, 91, 0.12);
}

.record-quality-counts .severity-medium {
  color: #a45a18;
  background: rgba(255, 152, 84, 0.14);
}

.record-quality-counts .severity-low {
  color: #126c92;
  background: rgba(50, 197, 255, 0.12);
}

td.number {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  border: 1px solid var(--line);
}

.badge.teal {
  background: var(--aqua-soft);
  color: #118a7b;
}

.badge.amber {
  background: var(--orange-soft);
  color: #b45a1e;
}

.org-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.org-flow-panel {
  margin-bottom: 14px;
}

.org-flow {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 24px minmax(120px, 1fr) 24px minmax(160px, 1fr) 24px minmax(140px, 1fr) 24px minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
}

.org-flow span {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue-soft), var(--aqua-soft));
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  text-align: center;
}

.org-flow i {
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--aqua));
  border-radius: 999px;
}

.org-card {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}

.org-card h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
  font-weight: 820;
}

.org-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.org-card li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 35, 52, 0.32);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.notification-backdrop {
  align-items: stretch;
  justify-content: flex-end;
  place-items: stretch end;
  padding: 14px;
}

.notification-drawer {
  width: min(420px, calc(100vw - 28px));
  min-height: min(680px, calc(100vh - 28px));
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.9));
  box-shadow: 0 24px 70px rgba(38, 67, 108, 0.2);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  animation: drawerIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.notification-settings-panel {
  margin: 0 14px;
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 14px;
  background: rgba(247, 250, 255, 0.78);
  display: grid;
  gap: 8px;
}

.notification-settings-panel label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.browser-notification-setting {
  padding: 10px;
  border: 1px solid rgba(84, 122, 255, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(84, 122, 255, 0.08), rgba(50, 197, 255, 0.05));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.notification-settings-panel input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.notification-settings-panel span,
.browser-notification-setting span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-settings-panel b,
.browser-notification-setting b {
  color: var(--ink);
  font-size: 13px;
}

.notification-settings-panel small,
.browser-notification-setting small {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.35;
}

.notification-list {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.notification-item {
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-left-width: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.notification-item.is-read {
  opacity: 0.62;
  background: rgba(255, 255, 255, 0.52);
}

.notification-item div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notification-item b {
  color: var(--ink);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notification-item b i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 91, 91, 0.1);
}

.notification-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notification-empty {
  min-height: 220px;
}

.modal {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.modal-head {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  z-index: 2;
  border-bottom: 1px solid var(--line);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.modal-head h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 860;
}

.modal-body {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-actions {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: rgba(21, 86, 207, 0.94);
  color: #fff;
  padding: 12px 14px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: 360px;
}

.empty {
  padding: 42px 18px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .login-page,
  .app-shell,
  .grid-2,
  .dashboard-grid,
  .dashboard-grid-3,
  .comparison-grid,
  .branch-card-grid,
  .daily-trend-grid {
    grid-template-columns: 1fr;
  }

  .app-shell,
  .login-page {
    padding: 14px;
  }

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

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

  .kpi-grid,
  .permission-map,
  .org-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .login-panel,
  .login-aside-inner,
  .topbar,
  .panel {
    padding: 16px;
  }

  .login-page,
  .app-shell,
  .kpi-grid,
  .permission-map,
  .org-grid,
  .toolbar,
  .modal-body,
  .chart-summary,
  .donut-wrap,
  .metric-rings,
  .count-tiles,
  .comparison-grid,
  .branch-card-grid,
  .daily-trend-grid,
  .daily-trend-body,
  .daily-trend-metrics,
  .org-flow {
    grid-template-columns: 1fr;
  }

  .org-flow i {
    width: 2px;
    height: 18px;
    justify-self: center;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .top-actions .select {
    width: 100%;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .kpi {
    min-height: 116px;
  }

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

  .kpi-ring {
    width: 46px;
    height: 46px;
  }

  .donut {
    width: min(180px, 58vw);
    justify-self: center;
  }

  .trend-chart svg {
    min-width: 0;
  }
}

/* Compact schedule-dashboard refresh inspired by the referenced layout. */
:root {
  --bg: #ebeef7;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-soft: #f6f8fd;
  --ink: #172033;
  --muted: #6d778b;
  --subtle: #97a1b4;
  --line: #dfe4ee;
  --line-strong: #cbd5e6;
  --blue: #3547e8;
  --blue-deep: #1f2d9f;
  --cyan: #54b8ff;
  --aqua: #16b8a6;
  --green: #23a86f;
  --orange: #ee7b49;
  --pink: #e36a7c;
  --violet: #7657e6;
  --danger: #db5d62;
  --blue-soft: rgba(53, 71, 232, 0.1);
  --cyan-soft: rgba(84, 184, 255, 0.12);
  --aqua-soft: rgba(22, 184, 166, 0.11);
  --orange-soft: rgba(238, 123, 73, 0.12);
  --pink-soft: rgba(227, 106, 124, 0.12);
  --shadow: 0 18px 42px rgba(39, 49, 80, 0.11);
  --shadow-soft: 0 8px 22px rgba(39, 49, 80, 0.07);
  --radius: 8px;
  --radius-small: 6px;
}

body {
  background: var(--bg);
}

body::before {
  display: none;
}

.login-panel,
.login-aside-inner,
.sidebar,
.topbar,
.panel,
.kpi,
.table-wrap,
.modal,
.org-card,
.permission-item,
.user-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.input,
.select {
  height: 38px;
  border-radius: 8px;
  background: #fff;
  padding: 0 11px;
  box-shadow: none;
  font-size: 13px;
}

.btn {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  box-shadow: none;
  font-size: 13px;
}

.btn.primary,
.btn.primary:hover {
  background: var(--blue);
}

.btn:hover {
  transform: none;
  box-shadow: 0 8px 18px rgba(53, 71, 232, 0.13);
}

.app-shell {
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.sidebar {
  top: 12px;
  height: calc(100vh - 24px);
  border-radius: 8px;
  padding: 12px;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.brand {
  padding: 6px 6px 10px;
  border-bottom: 1px solid var(--line);
}

.brand h1 {
  font-size: 18px;
}

.brand p {
  margin-top: 4px;
  font-size: 11px;
}

.nav {
  gap: 5px;
}

.nav button {
  min-height: 36px;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 13px;
}

.nav button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}

.nav button:not(.active):hover {
  background: var(--surface-soft);
}

.user-card {
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  box-shadow: none;
}

.main {
  gap: 12px;
}

.topbar {
  min-height: 58px;
  top: 12px;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.topbar h2 {
  font-size: 24px;
}

.topbar p {
  margin-top: 2px;
  font-size: 12px;
}

.top-actions {
  gap: 8px;
  flex-wrap: nowrap;
}

.top-actions .select {
  width: auto;
  min-width: 132px;
}

.content {
  gap: 10px;
}

.kpi-grid {
  gap: 10px;
}

.kpi {
  min-height: 88px;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff !important;
  box-shadow: var(--shadow-soft);
  gap: 8px;
}

.kpi::after {
  display: none;
}

.kpi-copy {
  gap: 4px;
}

.kpi span,
.kpi small {
  font-size: 12px;
}

.kpi strong {
  font-size: 22px;
}

.kpi-ring {
  width: 42px;
  height: 42px;
}

.ring-track,
.ring-value {
  stroke-width: 6;
}

.dashboard-grid,
.dashboard-grid-3,
.grid-2 {
  gap: 10px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.dashboard-grid-3 {
  grid-template-columns: minmax(260px, 0.9fr) minmax(240px, 0.7fr) minmax(240px, 0.7fr);
}

.panel {
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  margin-bottom: 10px;
}

.panel-head h3 {
  font-size: 15px;
}

.panel-head span {
  font-size: 12px;
}

.daily-chart {
  min-height: 198px;
}

.trend-chart {
  gap: 8px;
}

.chart-summary {
  gap: 8px;
}

.chart-summary div {
  border-radius: 8px;
  padding: 9px;
}

.chart-summary b {
  font-size: 15px;
}

.funnel {
  gap: 10px;
}

.funnel-track {
  height: 12px;
}

.donut-wrap {
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
}

.donut {
  width: 116px;
}

.donut::before {
  inset: 17px;
}

.donut b {
  font-size: 18px;
}

.metric-rings {
  gap: 7px;
}

.metric-ring {
  border-radius: 8px;
  padding: 8px 6px;
}

.metric-ring svg {
  width: 58px;
  height: 58px;
}

.count-tiles {
  gap: 8px;
}

.count-tile {
  min-height: 70px;
  border-radius: 8px;
  padding: 10px;
}

.count-tile b {
  font-size: 19px;
}

.comparison-grid {
  gap: 8px;
}

.comparison-card {
  min-height: 76px;
  border-radius: 8px;
  padding: 10px;
}

.comparison-card b {
  font-size: 18px;
}

.branch-card-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
}

.branch-stat-card {
  min-height: 230px;
  border-radius: 8px;
  padding: 11px;
  gap: 9px;
  background: #fff;
}

.branch-card-head h4 {
  font-size: 15px;
}

.branch-card-head b,
.daily-trend-head b,
.badge {
  border-radius: 6px;
}

.branch-sales-focus {
  gap: 6px;
}

.branch-sales-focus strong {
  font-size: 22px;
}

.branch-progress {
  height: 6px;
}

.branch-metric-grid {
  gap: 6px;
}

.branch-metric-grid div {
  min-height: 50px;
  border-radius: 8px;
  padding: 7px;
}

.branch-metric-grid b {
  font-size: 13px;
}

.daily-trend-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
}

.daily-trend-card {
  min-height: 150px;
  border-radius: 8px;
  padding: 10px;
  gap: 7px;
  background: #fff;
}

.daily-trend-head h4 {
  font-size: 17px;
}

.daily-trend-body {
  grid-template-columns: minmax(0, 0.48fr) minmax(0, 0.52fr);
  gap: 7px;
}

.daily-today-focus {
  gap: 4px;
}

.daily-today-focus strong {
  font-size: 21px;
}

.daily-sparkline {
  min-height: 46px;
}

.daily-trend-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.daily-trend-metrics div {
  min-height: 34px;
  border-radius: 8px;
  padding: 5px;
}

.daily-trend-metrics b {
  font-size: 11px;
}

.rank-list {
  gap: 8px;
}

.rank-row {
  gap: 8px;
}

.rank-track {
  height: 6px;
  margin-top: 5px;
}

.toolbar {
  gap: 8px;
}

.table-wrap {
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

th,
td {
  padding: 9px 10px;
  font-size: 12px;
}

.org-flow span,
.org-card,
.permission-item,
.login-panel,
.login-aside-inner,
.modal {
  border-radius: 8px;
}

.org-grid {
  gap: 10px;
}

.org-card {
  padding: 12px;
}

.modal-head,
.modal-actions {
  padding: 12px;
}

.modal-body {
  padding: 12px;
  gap: 10px;
}

@media (max-width: 1180px) {
  .branch-card-grid,
  .daily-trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar,
  .topbar {
    position: static;
    height: auto;
  }

  .kpi-grid,
  .dashboard-grid,
  .dashboard-grid-3,
  .grid-2,
  .branch-card-grid,
  .daily-trend-grid,
  .daily-trend-body,
  .daily-trend-metrics {
    grid-template-columns: 1fr;
  }
}

/* ColorOS glass refresh: keeps the compact dashboard, adds depth and motion. */
:root {
  --bg: #eef3f9;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-solid: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(248, 251, 255, 0.8);
  --line: rgba(85, 116, 150, 0.15);
  --line-strong: rgba(53, 71, 232, 0.2);
  --shadow: 0 24px 60px rgba(36, 72, 116, 0.14);
  --shadow-soft: 0 12px 34px rgba(38, 76, 122, 0.1);
  --blur: saturate(180%) blur(22px);
  --radius: 18px;
  --radius-small: 10px;
}

body {
  background:
    linear-gradient(135deg, rgba(84, 184, 255, 0.18), transparent 34%),
    linear-gradient(225deg, rgba(118, 87, 230, 0.14), transparent 38%),
    linear-gradient(25deg, rgba(22, 184, 166, 0.12), transparent 42%),
    var(--bg);
}

body::before {
  display: block;
  background:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.46) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.34), transparent 72%);
}

.login-panel,
.login-aside-inner,
.sidebar,
.topbar,
.panel,
.kpi,
.table-wrap,
.modal,
.org-card,
.permission-item,
.user-card {
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.sidebar,
.topbar,
.panel,
.table-wrap,
.modal,
.org-card,
.permission-item,
.user-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.sidebar,
.topbar,
.panel,
.table-wrap,
.modal,
.org-card,
.permission-item,
.user-card,
.kpi {
  border-radius: var(--radius);
}

.input,
.select {
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(128, 151, 176, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(37, 68, 110, 0.05);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.input:hover,
.select:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(53, 71, 232, 0.28);
}

.input:focus,
.select:focus {
  transform: translateY(-1px);
  border-color: rgba(53, 71, 232, 0.46);
  box-shadow:
    0 0 0 5px rgba(53, 71, 232, 0.1),
    0 12px 28px rgba(53, 71, 232, 0.12);
}

.btn {
  min-height: 40px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(37, 68, 110, 0.08);
}

.btn.primary,
.btn.primary:hover {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(53, 71, 232, 0.16);
}

.nav button {
  border-radius: 14px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.nav button.active {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 28px rgba(53, 71, 232, 0.22);
}

.nav button:hover {
  transform: translateY(-1px);
}

.kpi {
  min-height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62)),
    linear-gradient(135deg, var(--blue-soft), transparent 58%) !important;
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
  animation: cardRise 420ms ease both;
}

.kpi:nth-child(2) {
  animation-delay: 60ms;
}

.kpi:nth-child(3) {
  animation-delay: 120ms;
}

.kpi:nth-child(4) {
  animation-delay: 180ms;
}

.kpi:hover,
.panel:hover,
.table-wrap:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.kpi strong {
  font-size: 28px;
}

.ring-value {
  animation: ringReveal 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel,
.table-wrap {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
  animation: cardRise 460ms ease both;
}

.panel {
  padding: 16px;
}

.trend-chart svg {
  filter: drop-shadow(0 14px 24px rgba(47, 125, 246, 0.08));
}

.sales-area {
  animation: areaFade 680ms ease both;
}

.sales-line {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: lineDraw 950ms ease forwards;
}

.spend-line {
  stroke-dasharray: 4 9;
  animation: dashFlow 1.9s linear infinite;
}

.sales-dot {
  animation: dotPop 520ms ease both;
}

.funnel-fill {
  transform-origin: left center;
  animation: barGrow 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.donut {
  animation: cardRise 500ms ease both, softSpin 900ms ease both;
}

.count-tile,
.metric-ring,
.comparison-card,
.branch-stat-card,
.daily-trend-card {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.72);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.count-tile:hover,
.metric-ring:hover,
.comparison-card:hover,
.branch-stat-card:hover,
.daily-trend-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 68, 110, 0.1);
}

.modal-backdrop {
  background:
    linear-gradient(135deg, rgba(15, 24, 40, 0.34), rgba(72, 93, 125, 0.24));
  animation: backdropIn 180ms ease both;
}

.modal {
  width: min(840px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 252, 255, 0.9));
  border-radius: 22px;
  animation: modalSlide 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-head,
.modal-actions {
  background: rgba(255, 255, 255, 0.86);
}

.new-select-field,
.new-wechat-field {
  animation: fieldReveal 180ms ease both;
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@keyframes ringReveal {
  from {
    stroke-dashoffset: 120;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes areaFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes lineDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -26;
  }
}

@keyframes dotPop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes barGrow {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes softSpin {
  from {
    filter: saturate(0.8);
  }

  to {
    filter: saturate(1);
  }
}

@keyframes backdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawerIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

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

@keyframes fieldReveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

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

/* Merged dashboard polish from the local reference: denser, icon-led, and latest-day first. */
.panel-head h3,
.kpi span,
.nav button,
.brand h1 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-head h3 .ui-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  color: var(--blue);
  background: rgba(53, 71, 232, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.trend-panel .panel-head h3 .ui-icon,
.metric-panel .panel-head h3 .ui-icon {
  color: var(--blue);
  background: rgba(53, 71, 232, 0.1);
}

.mix-panel .panel-head h3 .ui-icon,
.branch-daily-panel .panel-head h3 .ui-icon {
  color: var(--aqua);
  background: rgba(22, 184, 166, 0.11);
}

.count-panel .panel-head h3 .ui-icon,
.branch-summary-panel .panel-head h3 .ui-icon {
  color: var(--violet);
  background: rgba(118, 87, 230, 0.1);
}

.panel-head > span {
  white-space: nowrap;
}

.chart-summary {
  grid-template-columns: 1.18fr 1fr 1fr;
}

.chart-summary .is-highlight {
  color: #fff;
  border-color: rgba(53, 71, 232, 0.18);
  background:
    linear-gradient(135deg, rgba(53, 71, 232, 0.96), rgba(32, 214, 189, 0.82)),
    var(--blue);
  box-shadow: 0 14px 30px rgba(53, 71, 232, 0.18);
}

.chart-summary .is-highlight b,
.chart-summary .is-highlight span {
  color: #fff;
}

.branch-stat-card.is-empty,
.daily-trend-card.is-empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.44)),
    repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0 8px, transparent 8px 16px);
}

.branch-stat-card.is-empty .branch-progress i {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.45), rgba(148, 163, 184, 0.22));
}

.branch-stat-card.is-empty .branch-card-head b,
.daily-trend-card.is-empty .daily-trend-head b {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}

.daily-trend-card {
  position: relative;
  overflow: hidden;
}

.daily-trend-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 14px auto;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(53, 71, 232, 0.08), rgba(22, 184, 166, 0.1));
  pointer-events: none;
}

.daily-today-focus {
  min-height: 94px;
  padding: 12px;
  border: 1px solid rgba(53, 71, 232, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.5)),
    linear-gradient(135deg, rgba(53, 71, 232, 0.1), rgba(22, 184, 166, 0.08));
  align-content: center;
}

.daily-today-focus strong {
  color: var(--blue-deep);
}

.daily-trend-metrics div {
  position: relative;
  overflow: hidden;
}

.daily-trend-metrics div::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--aqua);
  position: absolute;
  right: 8px;
  top: 8px;
  opacity: 0.72;
}

.daily-trend-metrics div:nth-child(2)::before {
  background: var(--orange);
}

.daily-trend-metrics div:nth-child(3)::before {
  background: var(--violet);
}

.daily-trend-metrics div:nth-child(4)::before {
  background: var(--blue);
}

/* Airtable/Feishu-like record grid for the four daily reports. */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.record-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.filter-main {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 150px auto auto;
  gap: 10px;
  align-items: center;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions .btn,
.filter-main .btn {
  white-space: nowrap;
}

.record-date-presets {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.record-date-presets button {
  min-height: 30px;
  border: 1px solid rgba(84, 122, 255, 0.16);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.record-date-presets button:hover,
.record-date-presets button.active {
  color: var(--blue-deep);
  border-color: rgba(84, 122, 255, 0.3);
  background: rgba(84, 122, 255, 0.12);
}

.mini-filter {
  display: grid;
  gap: 6px;
}

.mini-filter span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 720;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.filter-chips button {
  min-height: 28px;
  border: 1px solid rgba(53, 71, 232, 0.18);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(53, 71, 232, 0.08);
  color: var(--blue-deep);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 720;
}

.filter-chips span {
  color: var(--muted);
  font-weight: 650;
}

.filter-chips button.clear-all {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.record-keyboard-bar {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.record-keyboard-current {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(90px, auto) minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.record-keyboard-current span,
.record-keyboard-current small,
.record-keyboard-current i {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.35;
}

.record-keyboard-current b,
.record-keyboard-current small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-keyboard-current b {
  color: var(--ink);
  font-size: 13px;
}

.record-keyboard-current i {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.record-keyboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.record-keyboard-actions span,
.record-keyboard-actions .btn {
  min-height: 30px;
  font-size: 12px;
}

.record-keyboard-actions span {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 760;
}

.record-keyboard-actions kbd {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(134, 152, 185, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "SF Mono", "Roboto Mono", monospace;
  font-size: 10px;
  font-weight: 850;
}

.record-detail-modal {
  max-width: 760px;
}

.record-detail-hero {
  margin: 10px 14px 0;
  padding: 14px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(84, 122, 255, 0.1), rgba(50, 197, 255, 0.08)),
    rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 4px;
}

.record-detail-hero span,
.record-detail-hero small {
  color: var(--subtle);
  font-size: 12px;
}

.record-detail-hero b {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.record-detail-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.record-detail-grid article {
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(134, 152, 185, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  display: grid;
  align-content: space-between;
  gap: 6px;
  min-width: 0;
}

.record-detail-grid span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.record-detail-grid b {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.record-detail-actions {
  flex-wrap: wrap;
}

.base-table-wrap {
  border-radius: 18px;
  background: rgba(247, 251, 255, 0.78);
  border-color: rgba(178, 193, 214, 0.55);
  box-shadow: 0 10px 28px rgba(37, 68, 110, 0.08);
}

.base-table-wrap table {
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.52);
}

.base-table-wrap th,
.base-table-wrap td {
  height: 42px;
  padding: 0 12px;
  border-right: 1px solid rgba(178, 193, 214, 0.42);
  border-bottom: 1px solid rgba(178, 193, 214, 0.48);
  background: rgba(255, 255, 255, 0.46);
  font-size: 13px;
}

.base-table-wrap th {
  top: 0;
  z-index: 2;
  background: rgba(239, 246, 253, 0.96);
  color: #66748a;
}

.base-table-wrap tbody tr:nth-child(even) td {
  background: rgba(246, 249, 253, 0.58);
}

.base-table-wrap tbody tr:hover td {
  background: rgba(47, 125, 246, 0.08);
}

.base-table-wrap tbody tr.is-editable {
  cursor: pointer;
}

.base-table-wrap tbody tr.is-editable:hover td:first-child {
  box-shadow: inset 4px 0 0 rgba(47, 125, 246, 0.62);
}

.base-table-wrap tbody tr.is-readonly {
  cursor: default;
}

.base-table-wrap tbody tr.is-selected td {
  background: rgba(84, 122, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(84, 122, 255, 0.12), inset 0 -1px 0 rgba(84, 122, 255, 0.12);
}

.base-table-wrap tbody tr.is-selected td:first-child {
  color: var(--blue-deep);
  box-shadow: inset 4px 0 0 var(--violet);
}

.base-table-wrap td.record-cell-alert {
  background:
    linear-gradient(135deg, rgba(255, 152, 84, 0.15), rgba(255, 255, 255, 0.62)) !important;
  color: #8b3f10;
  box-shadow: inset 0 0 0 1px rgba(255, 152, 84, 0.18);
  font-weight: 840;
}

.base-table-wrap tr.record-row-alert td.row-index {
  color: #a45a18;
  box-shadow: inset 4px 0 0 rgba(255, 152, 84, 0.75);
}

.base-table-wrap .row-index {
  width: 54px;
  min-width: 54px;
  text-align: center;
  color: var(--subtle);
  background: rgba(237, 244, 252, 0.96);
  position: sticky;
  left: 0;
  z-index: 3;
}

.base-table-wrap td.row-index {
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

.record-actions-th,
.record-actions-cell {
  width: 232px;
  min-width: 232px;
}

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

.review-status {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  font-size: 12px;
  font-weight: 820;
  vertical-align: middle;
  color: var(--subtle);
  background: rgba(148, 163, 184, 0.12);
}

.review-approved {
  color: #176b4d;
  background: rgba(54, 199, 134, 0.12);
}

.review-rejected {
  color: #b42318;
  background: rgba(239, 91, 91, 0.12);
}

.record-actions-cell .btn,
.record-card-actions .btn {
  margin-right: 5px;
}

.record-pagination {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.record-pagination > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.record-pagination b {
  color: var(--ink);
  font-size: 13px;
}

.record-pagination span,
.record-page-controls label span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.record-page-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.record-page-controls > span {
  min-width: 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.record-page-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.record-page-controls .select {
  width: 74px;
}

.danger-text {
  color: #b42318 !important;
}

.danger-bg {
  background: linear-gradient(135deg, #ef5b5b, #ff9854) !important;
  color: #fff !important;
}

.sort-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 780;
}

.sort-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-button i {
  flex: 0 0 auto;
  color: var(--subtle);
  font-style: normal;
  font-size: 12px;
}

.sort-button.active {
  color: var(--blue);
}

.sort-button.active i {
  color: var(--blue);
}

.sort-button:hover {
  color: var(--blue-deep);
}

/* Production polish: quieter surfaces, denser admin tables, clearer form states. */
body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(145deg, #f8fbff 0%, #f3f7fb 48%, #edf5f8 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

body::before {
  opacity: 0.34;
}

.panel,
.table-wrap,
.org-card,
.modal,
.login-panel,
.login-aside-inner {
  backdrop-filter: saturate(120%) blur(8px) !important;
  -webkit-backdrop-filter: saturate(120%) blur(8px) !important;
  border-color: rgba(178, 193, 214, 0.48) !important;
}

.account-admin-panel {
  margin-top: 16px;
}

.account-create-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1.1fr 1.1fr auto;
  gap: 10px;
  align-items: end;
}

.admin-table-wrap table {
  min-width: 1180px;
}

.admin-table-wrap th,
.admin-table-wrap td {
  height: 46px;
  padding: 8px 10px;
  vertical-align: middle;
}

.table-input {
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 13px;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.mini-btn {
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
}

.danger-badge {
  color: #b42318;
  background: rgba(239, 91, 91, 0.12);
  border-color: rgba(239, 91, 91, 0.25);
}

.warning-badge {
  color: #9a4b13;
  background: rgba(255, 152, 84, 0.13);
  border-color: rgba(255, 152, 84, 0.28);
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.org-architecture-panel {
  margin-bottom: 16px;
  animation: none !important;
  opacity: 1 !important;
}

.org-architecture-panel .panel-head {
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.org-architecture-panel .panel-head > span {
  max-width: min(620px, 100%);
  line-height: 1.45;
  white-space: normal;
  text-align: left;
  min-width: 0;
  overflow-wrap: anywhere;
}

.org-architecture {
  display: grid;
  gap: 14px;
}

.hq-structure {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) 28px minmax(180px, 0.55fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hq-structure > i,
.branch-chain > i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--violet), var(--aqua));
}

.branch-structure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}

.branch-structure-card {
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.72)),
    radial-gradient(circle at 88% 10%, rgba(136, 76, 255, 0.1), transparent 34%);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 12px;
  animation: none !important;
  opacity: 1 !important;
  min-width: 0;
}

.account-admin-panel {
  animation: none !important;
  opacity: 1 !important;
}

.branch-structure-card.is-building {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(246, 249, 253, 0.7)),
    repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0 8px, transparent 8px 16px);
}

.branch-structure-head,
.branch-structure-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.branch-structure-head > div,
.branch-structure-foot > span {
  min-width: 0;
}

.branch-structure-head span,
.branch-structure-foot span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.branch-structure-head h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.branch-structure-head b,
.branch-structure-foot b {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #5c36d7;
  background: rgba(136, 76, 255, 0.1);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.branch-chain {
  display: grid;
  gap: 10px;
}

.branch-chain > i {
  width: 2px;
  height: 18px;
  justify-self: center;
  background: linear-gradient(180deg, var(--blue), var(--violet), var(--aqua));
}

.chain-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.org-node {
  min-height: 0;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}

.org-node > span,
.frontline-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  min-width: 0;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.node-violet {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(240, 232, 255, 0.72));
}

.node-blue {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(232, 241, 255, 0.72));
}

.node-gold {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 248, 221, 0.72));
}

.node-pink {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 232, 244, 0.72));
}

.node-aqua {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(228, 252, 248, 0.72));
}

.org-node-people,
.frontline-group div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
  align-items: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.org-node-people {
  max-height: 112px;
}

.frontline-group div {
  max-height: 94px;
}

.org-node small,
.frontline-group small,
.org-node em,
.frontline-group em {
  max-width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  display: -webkit-box;
  flex: 0 1 auto;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  box-shadow: inset 0 0 0 1px rgba(134, 152, 185, 0.12);
  overflow: hidden;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.org-node-people > small,
.org-node-people > em,
.frontline-group div > small,
.frontline-group div > em {
  width: 100%;
}

.org-node em,
.frontline-group em {
  color: var(--subtle);
  font-weight: 720;
}

.org-node small.is-disabled,
.frontline-group small.is-disabled {
  color: var(--subtle);
  text-decoration: line-through;
  background: rgba(148, 163, 184, 0.12);
}

.frontline-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  min-width: 0;
}

.frontline-group {
  min-height: 0;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.64);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}

.frontline-group b {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-section {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(178, 193, 214, 0.5);
  border-radius: 14px;
  background: rgba(249, 252, 255, 0.72);
}

.form-section + .form-section {
  margin-top: 12px;
}

.form-section legend {
  padding: 0 7px;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 820;
}

.form-section legend span,
.form-section legend small {
  display: inline-flex;
  align-items: center;
}

.form-section legend small {
  margin-left: 8px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 650;
}

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

.record-form-assist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 125, 246, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(47, 125, 246, 0.08), rgba(32, 214, 189, 0.05)),
    rgba(255, 255, 255, 0.72);
}

.record-form-assist div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.record-form-assist b {
  color: var(--ink);
  font-size: 12px;
}

.record-form-assist span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-alert {
  padding: 10px 12px;
  border: 1px solid rgba(255, 152, 84, 0.34);
  border-radius: 12px;
  background: rgba(255, 152, 84, 0.1);
  color: #9a4b13;
  font-size: 13px;
  font-weight: 720;
}

.draft-recovered-alert {
  border-color: rgba(14, 165, 233, 0.26);
  background: rgba(239, 246, 255, 0.92);
  color: #075985;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-validation-panel {
  padding: 10px 12px;
  border: 1px solid rgba(47, 125, 246, 0.18);
  border-radius: 12px;
  background: rgba(245, 249, 255, 0.86);
  display: grid;
  gap: 8px;
}

.form-validation-panel.has-blockers {
  border-color: rgba(239, 91, 91, 0.34);
  background: rgba(255, 245, 245, 0.88);
}

.form-validation-panel.has-warnings {
  border-color: rgba(255, 152, 84, 0.32);
  background: rgba(255, 248, 241, 0.88);
}

.form-validation-panel b {
  color: var(--ink);
  font-size: 13px;
}

.form-validation-panel div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.validation-chip {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
  box-shadow: inset 0 0 0 1px rgba(134, 152, 185, 0.14);
}

.validation-chip.severity-high {
  color: #b42318;
  box-shadow: inset 0 0 0 1px rgba(239, 91, 91, 0.28);
}

.validation-chip.severity-medium {
  color: #9a4b13;
  box-shadow: inset 0 0 0 1px rgba(255, 152, 84, 0.28);
}

.field.is-invalid .input,
.field.is-invalid .select {
  border-color: rgba(239, 91, 91, 0.58) !important;
  background: rgba(255, 245, 245, 0.92);
}

.field.is-warning .input,
.field.is-warning .select {
  border-color: rgba(255, 152, 84, 0.5) !important;
  background: rgba(255, 248, 241, 0.92);
}

.template-tools {
  padding: 10px 12px;
  border: 1px solid rgba(126, 85, 255, 0.18);
  border-radius: 13px;
  background: rgba(126, 85, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-tools div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.template-tools b {
  color: var(--ink);
  font-size: 13px;
}

.template-tools span {
  color: var(--subtle);
  font-size: 12px;
}

.smart-suggestion-panel {
  padding: 11px 12px;
  border: 1px solid rgba(54, 199, 134, 0.2);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(242, 253, 248, 0.72));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.smart-suggestion-panel > div:first-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.smart-suggestion-panel b {
  color: var(--ink);
  font-size: 13px;
}

.smart-suggestion-panel span {
  color: var(--subtle);
  font-size: 12px;
}

.suggestion-chips {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggestion-chips span {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 760;
  box-shadow: inset 0 0 0 1px rgba(134, 152, 185, 0.12);
}

.suggestion-chips b {
  color: #227d5c;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.suggestion-overview {
  grid-column: 2 / -1;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.suggestion-overview span {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #227d5c;
  background: rgba(54, 199, 134, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
}

.suggestion-overview b {
  color: #227d5c;
  font-size: 11px;
}

.suggestion-overview-chips {
  grid-row: 3;
}

.suggestion-confidence {
  grid-column: 2;
  grid-row: 1;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #227d5c;
  background: rgba(54, 199, 134, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
}

.smart-suggestion-panel .btn {
  grid-column: 3;
  grid-row: 1;
}

.import-modal {
  width: min(920px, calc(100vw - 28px));
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.import-summary div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(178, 193, 214, 0.45);
  border-radius: 14px;
  background: rgba(249, 252, 255, 0.76);
}

.import-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.import-summary b {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
}

.import-preview-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.import-export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(86px, auto);
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 14px;
  background: rgba(247, 250, 255, 0.72);
  min-width: 0;
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 820;
}

.segmented-control button.active {
  color: var(--blue-deep);
  background: rgba(84, 122, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(84, 122, 255, 0.1);
}

.segmented-control b {
  min-width: 22px;
  height: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(134, 152, 185, 0.12);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.preview-table-wrap {
  max-height: 380px;
  overflow: auto;
  margin-top: 12px;
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
}

@media (max-width: 1180px) {
  .rank-podium {
    grid-template-columns: 1fr;
    align-items: stretch;
    min-height: auto;
  }

  .podium-card,
  .podium-gold {
    min-height: 118px;
    padding: 18px 14px 18px 86px;
    justify-items: start;
    text-align: left;
    transform: none;
  }

  .medal,
  .podium-gold .medal {
    left: 18px;
    top: 50%;
    width: 54px;
    height: 54px;
    border-width: 6px;
    transform: translateY(-50%);
  }

  .podium-gold .medal span {
    font-size: 24px;
  }

  .medal i {
    display: none;
  }

  .account-create-grid,
  .filter-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-create-grid .btn,
  .filter-main .btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
    padding: 10px 10px 78px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    display: none !important;
  }

  .main {
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 20px);
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    top: 8px;
    z-index: 20;
    min-height: auto;
    padding: 12px;
    border-radius: 18px !important;
    display: grid;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .top-actions > * {
    min-width: 0 !important;
    max-width: 100%;
  }

  .top-actions .select,
  .top-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .notification-button b {
    right: 4px;
    top: -3px;
  }

  .content {
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .content > *,
  .panel,
  .record-panel {
    max-width: 100%;
    box-sizing: border-box;
  }

  .kpi-grid {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }

  .kpi {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  .dashboard-grid,
  .dashboard-grid-3,
  .grid-2,
  .branch-card-grid,
  .daily-trend-grid {
    grid-template-columns: 1fr !important;
  }

  .record-tools,
  .filter-main,
  .filter-grid {
    grid-template-columns: 1fr !important;
  }

  .base-table-wrap {
    display: none;
  }

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

  .bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 80;
    min-height: 64px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 44px rgba(91, 110, 160, 0.2);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(58px, 1fr);
    gap: 4px;
    overflow-x: auto;
  }

  .bottom-nav-item {
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 760;
  }

  .bottom-nav-item .ui-icon {
    width: 20px;
    height: 20px;
  }

  .bottom-nav-item.active {
    color: #fff;
    background: var(--candy-gradient);
    box-shadow: 0 12px 28px rgba(126, 85, 255, 0.22);
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .modal {
    width: 100%;
    min-height: 100vh;
    border-radius: 0 !important;
  }

  .form-section-grid,
  .import-summary,
  .account-create-grid {
    grid-template-columns: 1fr;
  }

  .import-export-actions,
  .import-export-actions .btn {
    width: 100%;
  }
}

/* Candy cloud theme inspired by the reference: pale canvas, saturated tiles, and water ripples. */
:root {
  --bg: #eaf1ff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-soft: rgba(250, 252, 255, 0.88);
  --ink: #1f2433;
  --muted: #667088;
  --subtle: #9ba6ba;
  --line: rgba(125, 145, 178, 0.18);
  --line-strong: rgba(139, 83, 255, 0.24);
  --blue: #4d86ff;
  --blue-deep: #315be8;
  --cyan: #39d0ff;
  --aqua: #2bd6c8;
  --green: #48cf88;
  --orange: #ffbf4f;
  --pink: #ff68a8;
  --violet: #884cff;
  --danger: #f05265;
  --blue-soft: rgba(77, 134, 255, 0.14);
  --cyan-soft: rgba(57, 208, 255, 0.16);
  --aqua-soft: rgba(43, 214, 200, 0.16);
  --orange-soft: rgba(255, 191, 79, 0.2);
  --pink-soft: rgba(255, 104, 168, 0.18);
  --shadow: 0 26px 70px rgba(96, 84, 180, 0.18);
  --shadow-soft: 0 14px 36px rgba(91, 110, 160, 0.12);
  --blur: saturate(145%) blur(16px);
  --candy-gradient: linear-gradient(135deg, #4d86ff 0%, #7e55ff 48%, #b23cff 100%);
  --sunset-gradient: linear-gradient(135deg, #ffbf4f 0%, #ff8f6b 54%, #ff68a8 100%);
  --pink-gradient: linear-gradient(135deg, #ff68a8 0%, #f25cc8 55%, #8b55ff 100%);
  --aqua-gradient: linear-gradient(135deg, #39d0ff 0%, #4d86ff 48%, #884cff 100%);
}

body {
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.86), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(172, 128, 255, 0.22), transparent 30%),
    radial-gradient(circle at 18% 88%, rgba(57, 208, 255, 0.22), transparent 34%),
    radial-gradient(circle at 80% 92%, rgba(255, 104, 168, 0.14), transparent 32%),
    linear-gradient(145deg, #f8fbff 0%, #edf4ff 45%, #e7f0ff 100%);
  background-size: 120% 120%, 120% 120%, 140% 140%, 140% 140%, auto;
  animation: waterField 18s ease-in-out infinite alternate;
}

body::before {
  display: block;
  z-index: 0;
  opacity: 0.72;
  background:
    repeating-radial-gradient(ellipse at 32% 28%, rgba(117, 82, 255, 0.08) 0 1px, transparent 1px 38px),
    repeating-radial-gradient(ellipse at 72% 76%, rgba(57, 208, 255, 0.08) 0 1px, transparent 1px 46px),
    linear-gradient(rgba(255, 255, 255, 0.42) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.36) 1px, transparent 1px);
  background-size: 360px 220px, 420px 260px, 52px 52px, 52px 52px;
  background-position: 0 0, 60px 30px, 0 0, 0 0;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.58), transparent 82%);
  animation: waterRippleField 14s ease-in-out infinite alternate;
}

.login-page,
.app-shell {
  position: relative;
  z-index: 1;
}

.login-page::before,
.app-shell::before {
  content: "";
  position: fixed;
  inset: 18px;
  z-index: -1;
  border-radius: 36px;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.2)),
    radial-gradient(circle at 24% 16%, rgba(255, 104, 168, 0.1), transparent 28%),
    radial-gradient(circle at 84% 24%, rgba(136, 76, 255, 0.12), transparent 32%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.sidebar,
.topbar,
.panel,
.table-wrap,
.modal,
.org-card,
.permission-item,
.user-card,
.login-panel,
.login-aside-inner {
  background: rgba(255, 255, 255, 0.78) !important;
  border-color: rgba(255, 255, 255, 0.84) !important;
  box-shadow: var(--shadow-soft) !important;
}

.sidebar,
.topbar,
.login-panel,
.login-aside-inner {
  border-radius: 24px !important;
}

.panel,
.table-wrap,
.modal,
.org-card,
.permission-item,
.user-card,
.kpi,
.branch-stat-card,
.daily-trend-card,
.podium-card {
  border-radius: 18px !important;
}

.brand .ui-icon,
.topbar .ui-icon,
.panel-head h3 .ui-icon {
  color: #fff !important;
  background: var(--candy-gradient) !important;
  box-shadow: 0 10px 24px rgba(126, 85, 255, 0.24) !important;
}

.brand h1,
.topbar h2,
.panel-head h3 {
  color: #202638 !important;
}

.btn.primary,
.btn.primary:hover,
.nav button.active,
.auth-switch button.active {
  color: #fff !important;
  background: var(--candy-gradient) !important;
  border-color: rgba(255, 255, 255, 0.26) !important;
  box-shadow: 0 16px 34px rgba(126, 85, 255, 0.28) !important;
}

.btn.ghost,
.auth-switch button,
.input,
.select {
  background: rgba(255, 255, 255, 0.84) !important;
  border-color: rgba(130, 145, 180, 0.16) !important;
}

.input:focus,
.select:focus {
  border-color: rgba(136, 76, 255, 0.46) !important;
  box-shadow:
    0 0 0 5px rgba(136, 76, 255, 0.1),
    0 12px 28px rgba(126, 85, 255, 0.12) !important;
}

.nav button:not(.active):hover {
  background: rgba(255, 255, 255, 0.76) !important;
}

.kpi {
  color: #fff;
  border: 0 !important;
  box-shadow: 0 22px 48px rgba(97, 103, 190, 0.18) !important;
}

.kpi:nth-child(1) {
  background: var(--aqua-gradient) !important;
}

.kpi:nth-child(2) {
  background: var(--candy-gradient) !important;
}

.kpi:nth-child(3) {
  background: var(--sunset-gradient) !important;
}

.kpi:nth-child(4) {
  background: var(--pink-gradient) !important;
}

.kpi::after {
  right: 18px;
  top: 14px;
  bottom: auto;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 14px 34px rgba(255, 255, 255, 0.1);
}

.kpi span,
.kpi small,
.kpi strong,
.kpi .ui-icon {
  color: #fff !important;
}

.kpi small,
.kpi span {
  opacity: 0.86;
}

.kpi .ring-track {
  stroke: rgba(255, 255, 255, 0.24);
}

.kpi .ring-value {
  stroke: rgba(255, 255, 255, 0.92) !important;
}

.trend-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(245, 248, 255, 0.76)),
    radial-gradient(circle at 90% 14%, rgba(136, 76, 255, 0.14), transparent 34%) !important;
}

.funnel-panel,
.metric-panel,
.mix-panel,
.count-panel,
.comparison-panel,
.branch-summary-panel,
.branch-daily-panel,
.rank-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(249, 251, 255, 0.72)),
    radial-gradient(circle at 90% 12%, rgba(77, 134, 255, 0.08), transparent 30%) !important;
}

.chart-summary .is-highlight,
.funnel-fill,
.branch-progress i,
.rank-fill {
  background: linear-gradient(90deg, #4d86ff, #884cff, #2bd6c8) !important;
}

.sales-line {
  stroke: #7e55ff !important;
}

.spend-line {
  stroke: #ffbf4f !important;
}

.sales-dot,
.daily-spark-dot {
  stroke: #ffbf4f !important;
}

.daily-spark-line {
  stroke: #884cff !important;
}

.daily-spark-area {
  fill: rgba(136, 76, 255, 0.12) !important;
}

.donut {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.9),
    0 18px 40px rgba(126, 85, 255, 0.16) !important;
}

.count-tile,
.metric-ring,
.branch-metric-grid div,
.daily-trend-metrics div,
.chart-summary div,
.comparison-card {
  background: rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(134, 152, 185, 0.16) !important;
}

.branch-stat-card:nth-child(1),
.daily-trend-card:nth-child(1) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(232, 240, 255, 0.72)) !important;
}

.branch-stat-card:nth-child(2),
.daily-trend-card:nth-child(2) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 245, 218, 0.72)) !important;
}

.branch-stat-card:nth-child(3),
.daily-trend-card:nth-child(3) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 232, 244, 0.72)) !important;
}

.branch-stat-card:nth-child(4),
.daily-trend-card:nth-child(4) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(232, 252, 249, 0.72)) !important;
}

.podium-gold {
  background:
    linear-gradient(180deg, rgba(255, 251, 225, 0.96), rgba(255, 255, 255, 0.74)),
    radial-gradient(circle at 50% 20%, rgba(255, 191, 79, 0.25), transparent 42%) !important;
}

.podium-silver {
  background:
    linear-gradient(180deg, rgba(238, 244, 255, 0.96), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at 50% 22%, rgba(77, 134, 255, 0.12), transparent 42%) !important;
}

.podium-bronze {
  background:
    linear-gradient(180deg, rgba(255, 238, 224, 0.96), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at 50% 22%, rgba(255, 104, 168, 0.14), transparent 42%) !important;
}

.medal {
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.24),
    0 12px 22px rgba(255, 191, 79, 0.28) !important;
}

.table-wrap,
.base-table-wrap {
  background: rgba(255, 255, 255, 0.82) !important;
}

.base-table-wrap th {
  background: rgba(244, 247, 255, 0.98) !important;
}

.base-table-wrap tbody tr:hover td {
  background: rgba(136, 76, 255, 0.07) !important;
}

.badge.teal,
.daily-trend-head b,
.branch-card-head b {
  color: #5c36d7 !important;
  background: rgba(136, 76, 255, 0.1) !important;
}

.ripple-surface {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.ripple-ink {
  position: absolute;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.42) 22%, rgba(136, 76, 255, 0.18) 46%, transparent 68%);
  transform: scale(0);
  opacity: 0.86;
  animation: waterClickRipple 720ms ease-out forwards;
}

.ripple-surface > :not(.ripple-ink) {
  position: relative;
  z-index: 1;
}

.bottom-nav,
.record-card-list {
  display: none;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
    padding: 12px 12px 82px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    display: none !important;
  }

  .main {
    gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 24px);
    overflow-x: hidden;
  }

  .topbar {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .base-table-wrap {
    display: none !important;
  }

  .record-card-list {
    display: grid !important;
  }

  .bottom-nav {
    display: grid !important;
  }
}

[data-action="drill-kpi"],
[data-action="drill-rank"] {
  cursor: pointer;
}

[data-action="drill-rank"]:hover {
  transform: translateY(-2px);
}

.record-card {
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.76)),
    radial-gradient(circle at 92% 12%, rgba(136, 76, 255, 0.1), transparent 36%);
  box-shadow: var(--shadow-soft);
}

.record-card.is-editable {
  cursor: pointer;
}

.record-card.is-editable:hover {
  border-color: rgba(47, 125, 246, 0.28);
  box-shadow: 0 14px 30px rgba(42, 64, 110, 0.1);
}

.record-card.is-readonly {
  cursor: default;
}

.record-card.is-selected {
  border-color: rgba(84, 122, 255, 0.34);
  box-shadow: 0 16px 34px rgba(84, 122, 255, 0.14), inset 4px 0 0 var(--violet);
}

.record-card.record-card-alert {
  border-color: rgba(255, 152, 84, 0.28);
  box-shadow: var(--shadow-soft), inset 4px 0 0 rgba(255, 152, 84, 0.76);
}

.record-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(134, 152, 185, 0.14);
}

.record-card-header b,
.record-card-header strong {
  color: var(--ink);
}

.record-card-header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.record-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.record-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(134, 152, 185, 0.14);
}

.record-card-metric {
  min-height: 58px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  align-content: space-between;
}

.record-card-metric.record-metric-alert {
  background: rgba(255, 247, 237, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 152, 84, 0.22);
}

.record-card-metric span {
  color: var(--subtle);
  font-size: 12px;
}

.record-card-metric b {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.password-field {
  position: relative;
  display: block;
}

.field .password-field {
  gap: 0;
}

.password-field .input {
  padding-right: 52px;
}

.icon-button {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  transform: translateY(-50%);
  color: var(--violet);
  background: rgba(136, 76, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
}

.auth-error {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid rgba(240, 82, 101, 0.28);
  border-radius: 12px;
  background: rgba(240, 82, 101, 0.1);
  color: #bd2840;
  font-size: 13px;
  font-weight: 760;
}

.auth-error small {
  margin-top: 4px;
  color: #9f1f34;
  display: block;
  font-size: 12px;
  font-weight: 720;
}

.auth-error.is-locked {
  border-color: rgba(202, 96, 23, 0.3);
  background: rgba(255, 152, 84, 0.12);
  color: #9a4b13;
}

.auth-error-form .input {
  border-color: rgba(240, 82, 101, 0.42) !important;
}

.shortcut-modal {
  max-width: 560px;
}

.shortcut-grid {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.shortcut-grid div {
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  display: flex;
  align-items: center;
  gap: 8px;
}

.shortcut-grid kbd {
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(134, 152, 185, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "SF Mono", "Roboto Mono", monospace;
  font-size: 12px;
  font-weight: 800;
}

.shortcut-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.shake {
  animation: shake 360ms ease;
}

.btn.is-loading .ui-icon {
  animation: spin 850ms linear infinite;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

@keyframes sectionPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(84, 122, 255, 0.24), var(--shadow-soft);
  }

  45% {
    box-shadow: 0 0 0 5px rgba(84, 122, 255, 0.18), var(--shadow-soft);
  }

  100% {
    box-shadow: var(--shadow-soft);
  }
}

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

@keyframes waterField {
  0% {
    background-position: 0% 0%, 100% 0%, 0% 100%, 100% 100%, center;
  }

  100% {
    background-position: 8% 5%, 92% 8%, 7% 92%, 94% 86%, center;
  }
}

@keyframes waterRippleField {
  0% {
    background-position: 0 0, 60px 30px, 0 0, 0 0;
    transform: scale(1);
  }

  100% {
    background-position: 36px 22px, 28px 58px, 10px 10px, -10px -8px;
    transform: scale(1.025);
  }
}

@keyframes waterClickRipple {
  0% {
    transform: scale(0);
    opacity: 0.78;
  }

  70% {
    opacity: 0.28;
  }

  100% {
    transform: scale(1);
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .bottom-nav {
    display: grid !important;
  }

  .record-card-list {
    display: grid !important;
  }

  .record-quality-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .record-quality-counts {
    justify-content: flex-start;
  }

  .record-quality-bar .btn {
    width: 100%;
  }

  .base-table-wrap {
    display: none !important;
  }

  .hq-structure,
  .branch-structure-grid,
  .chain-row,
  .frontline-groups {
    grid-template-columns: 1fr !important;
  }

  .hq-structure > i {
    width: 2px;
    height: 18px;
    justify-self: center;
    background: linear-gradient(180deg, var(--blue), var(--violet), var(--aqua));
  }

  .branch-structure-card {
    padding: 12px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .panel-head > span {
    white-space: normal !important;
    text-align: right;
  }

  .admin-table-wrap {
    max-width: 100%;
    overflow-x: auto !important;
    contain: inline-size;
  }

  .admin-table-wrap table {
    width: max-content;
  }

  .heatmap-shell {
    grid-template-columns: 1fr;
  }

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

  .heatmap-calendar {
    gap: 5px;
  }

  .heatmap-cell,
  .heatmap-cell.is-blank {
    min-height: 54px;
    padding: 6px;
  }

  .heatmap-cell small {
    display: none;
  }

  .heatmap-legend {
    grid-column: auto;
  }
}

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

  .ripple-ink {
    display: none !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --surface-soft: #f7fafc;
    --ink: #07111f;
    --muted: #243447;
    --subtle: #40536a;
    --line: rgba(7, 17, 31, 0.44);
    --line-strong: rgba(7, 17, 31, 0.68);
    --shadow: none;
    --shadow-soft: none;
    --blur: none;
  }

  body {
    background: #ffffff !important;
  }

  body::before,
  .app-shell::before,
  .app-shell::after {
    display: none !important;
  }

  .sidebar,
  .topbar,
  .panel,
  .table-wrap,
  .modal,
  .notification-drawer,
  .kpi,
  .branch-stat-card,
  .daily-trend-card,
  .podium-card,
  .count-tile,
  .system-status-banner,
  .target-progress-item,
  .target-history-month,
  .record-card,
  .record-filter-panel,
  .record-toolbar,
  .record-keyboard-bar,
  .approval-item,
  .org-task-card,
  .org-member-card,
  .org-insight-card,
  .branch-structure-card,
  .frontline-group,
  .org-node,
  .org-card,
  .org-tree-panel {
    border: 2px solid var(--line-strong) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .btn,
  .icon-button,
  .input,
  .select,
  .badge,
  .record-alert-tag,
  .status-pill,
  .account-status-pill,
  .permission-cell {
    border: 2px solid currentColor !important;
    box-shadow: none !important;
  }

  :where(button, input, select, textarea, [role="button"], .kpi, .podium-card, .rank-table-row):focus-visible {
    outline: 3px solid #000 !important;
    outline-offset: 3px !important;
  }

  .ring-track {
    stroke: rgba(7, 17, 31, 0.32) !important;
  }

  .ring-value,
  .daily-spark-line,
  .target-history-line,
  .sales-line,
  .spend-line,
  .target-history-dot,
  .sales-dot,
  .spend-dot {
    stroke-width: 4px !important;
  }

  .base-table-wrap th,
  .base-table-wrap td,
  .admin-table-wrap th,
  .admin-table-wrap td {
    border-bottom-color: rgba(7, 17, 31, 0.38) !important;
  }
}

@media (forced-colors: active) {
  :root {
    --bg: Canvas;
    --surface: Canvas;
    --surface-solid: Canvas;
    --surface-soft: Canvas;
    --ink: CanvasText;
    --muted: CanvasText;
    --subtle: CanvasText;
    --line: CanvasText;
    --line-strong: CanvasText;
    --blue: Highlight;
    --blue-deep: Highlight;
    --cyan: Highlight;
    --aqua: Highlight;
    --green: Highlight;
    --orange: Mark;
    --pink: Highlight;
    --violet: Highlight;
    --danger: Mark;
    --shadow: none;
    --shadow-soft: none;
    --blur: none;
  }

  *,
  *::before,
  *::after {
    forced-color-adjust: auto;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body,
  .login-page,
  .app-shell {
    background: Canvas !important;
    color: CanvasText !important;
  }

  body::before,
  .login-page::before,
  .login-panel::before,
  .app-shell::before,
  .app-shell::after,
  .water-ripple-layer,
  .ripple-ink {
    display: none !important;
  }

  :where(.login-panel, .login-aside-inner, .sidebar, .topbar, .panel, .table-wrap, .modal, .notification-drawer, .kpi, .record-card, .org-member-card, .org-tree-panel, .org-task-card, .branch-structure-card, .system-status-banner) {
    background: Canvas !important;
    border: 2px solid CanvasText !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  :where(.btn, .icon-button, .input, .select, textarea, .badge, .status-pill, .account-status-pill, .permission-cell, .record-alert-tag, .org-tree-node) {
    background: ButtonFace !important;
    color: ButtonText !important;
    border: 2px solid ButtonText !important;
  }

  :where(.btn.primary, .org-tree-node.active, button.active, .bottom-nav-item.active) {
    background: Highlight !important;
    color: HighlightText !important;
    border-color: Highlight !important;
  }

  :where(a, button, input, select, textarea, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 3px solid Highlight !important;
    outline-offset: 3px !important;
  }

  :where(svg, .ui-icon) {
    forced-color-adjust: auto;
  }

  :where(.ring-value, .sales-line, .spend-line, .daily-spark-line, .target-history-line) {
    stroke: Highlight !important;
  }

  :where(.ring-track, .grid-line, .axis-line) {
    stroke: CanvasText !important;
  }
}

.topbar {
  position: static !important;
  top: auto !important;
}

.compact-select,
.compact-date {
  width: auto !important;
  min-width: 112px !important;
  height: 38px !important;
  border-radius: 12px !important;
}

.dashboard-alerts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.heatmap-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.82)),
    radial-gradient(circle at 96% 6%, rgba(47, 125, 246, 0.1), transparent 32%);
}

.heatmap-shell {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(360px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.heatmap-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.heatmap-stats article {
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  align-content: space-between;
  min-width: 0;
  box-shadow: 0 8px 20px rgba(42, 64, 110, 0.06);
}

.heatmap-stats span,
.heatmap-cell small,
.heatmap-legend span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.heatmap-stats b {
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.heatmap-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.heatmap-calendar > strong {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1;
  text-align: center;
  padding-bottom: 2px;
}

.heatmap-cell {
  min-height: 70px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 8px;
  padding: 9px;
  background: rgba(244, 248, 253, 0.8);
  color: var(--muted);
  display: grid;
  align-content: space-between;
  gap: 3px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.heatmap-cell b {
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
}

.heatmap-cell span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 840;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-cell small {
  line-height: 1.15;
}

.heatmap-cell:hover {
  transform: translateY(-1px);
  border-color: rgba(84, 122, 255, 0.28);
  box-shadow: 0 12px 24px rgba(42, 64, 110, 0.12);
}

.heatmap-cell.is-blank {
  min-height: 70px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.heatmap-cell.is-today {
  outline: 2px solid rgba(136, 76, 255, 0.32);
  outline-offset: 2px;
}

.heatmap-cell.level-1 {
  background: linear-gradient(145deg, rgba(230, 244, 255, 0.9), rgba(213, 236, 255, 0.84));
}

.heatmap-cell.level-2 {
  background: linear-gradient(145deg, rgba(190, 225, 255, 0.94), rgba(158, 211, 255, 0.86));
}

.heatmap-cell.level-3 {
  background: linear-gradient(145deg, rgba(84, 122, 255, 0.86), rgba(47, 199, 219, 0.78));
}

.heatmap-cell.level-4 {
  background: linear-gradient(145deg, rgba(92, 54, 215, 0.92), rgba(47, 125, 246, 0.86));
}

.heatmap-cell.level-3 b,
.heatmap-cell.level-3 span,
.heatmap-cell.level-3 small,
.heatmap-cell.level-4 b,
.heatmap-cell.level-4 span,
.heatmap-cell.level-4 small {
  color: #fff;
}

.heatmap-legend {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: -4px;
}

.heatmap-legend i {
  width: 18px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(134, 152, 185, 0.14);
}

.heatmap-legend .level-0 {
  background: rgba(244, 248, 253, 0.8);
}

.heatmap-legend .level-1 {
  background: rgba(213, 236, 255, 0.84);
}

.heatmap-legend .level-2 {
  background: rgba(158, 211, 255, 0.86);
}

.heatmap-legend .level-3 {
  background: rgba(47, 199, 219, 0.78);
}

.heatmap-legend .level-4 {
  background: rgba(92, 54, 215, 0.92);
}

.target-progress-panel {
  display: grid;
  gap: 12px;
}

.target-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.target-progress-item {
  min-height: 138px;
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  align-content: space-between;
  gap: 9px;
  min-width: 0;
}

.target-progress-item.is-achieved {
  border-color: rgba(54, 199, 134, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(232, 252, 244, 0.72));
}

.target-progress-item.is-behind {
  border-color: rgba(255, 152, 84, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 247, 232, 0.76));
}

.target-progress-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  grid-template-columns: none !important;
  gap: 8px;
}

.target-progress-head strong {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--blue-deep);
  background: rgba(84, 122, 255, 0.1);
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 860;
  white-space: nowrap;
}

.target-progress-item.is-achieved .target-progress-head strong {
  color: #227d5c;
  background: rgba(54, 199, 134, 0.14);
}

.target-progress-item.is-behind .target-progress-head strong {
  color: #b85a10;
  background: rgba(255, 152, 84, 0.16);
}

.target-progress-item div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.target-progress-item span,
.target-progress-item small,
.target-scope-note span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.target-progress-item b {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.target-progress-item i {
  height: 8px;
  border-radius: 999px;
  background: rgba(134, 152, 185, 0.14);
  overflow: hidden;
}

.target-progress-item em {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--aqua));
  display: block;
}

.target-progress-item.is-achieved em {
  background: linear-gradient(90deg, var(--green), var(--aqua));
}

.target-progress-item.is-behind em {
  background: linear-gradient(90deg, var(--orange), #ffd66e);
}

.target-modal {
  max-width: 680px;
}

.drilldown-modal {
  width: min(1080px, calc(100vw - 32px));
}

.comments-modal {
  max-width: 760px;
}

.history-modal {
  max-width: 780px;
}

.review-modal {
  max-width: 680px;
}

.review-meta {
  padding: 10px 12px;
  border: 1px solid rgba(134, 152, 185, 0.14);
  border-radius: 12px;
  color: var(--subtle);
  background: rgba(247, 250, 255, 0.72);
  font-size: 12px;
  font-weight: 760;
}

.review-issue-panel {
  padding: 10px 12px;
  border: 1px solid rgba(255, 152, 84, 0.24);
  border-radius: 12px;
  background: rgba(255, 248, 239, 0.72);
  display: grid;
  gap: 7px;
}

.review-issue-panel.is-clear {
  border-color: rgba(54, 199, 134, 0.18);
  background: rgba(239, 253, 247, 0.72);
}

.review-issue-panel b {
  color: var(--ink);
  font-size: 13px;
}

.review-issue-panel div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.review-issue-panel span,
.review-issue-panel small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.review-actions {
  justify-content: space-between;
}

.review-queue-modal {
  width: min(980px, calc(100vw - 28px));
}

.review-queue-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.review-queue-summary article {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(249, 252, 255, 0.76);
  display: grid;
  align-content: space-between;
  min-width: 0;
}

.review-queue-summary span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.review-queue-summary b {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-queue-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.review-queue-list {
  max-height: min(56vh, 520px);
  overflow: auto;
  display: grid;
  gap: 8px;
}

.review-queue-item {
  padding: 10px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-left-width: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.review-queue-item.priority-high {
  border-left-color: var(--danger);
}

.review-queue-item.priority-medium {
  border-left-color: #ff9854;
}

.review-queue-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.review-queue-main > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.review-queue-main b,
.review-queue-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-queue-main b {
  color: var(--ink);
  font-size: 13px;
}

.review-queue-main small {
  color: var(--subtle);
  font-size: 12px;
}

.review-queue-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.review-queue-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.review-queue-actions .btn {
  min-width: 54px;
}

.comment-record-summary {
  padding: 12px;
  border: 1px solid rgba(84, 122, 255, 0.16);
  border-radius: 13px;
  background: rgba(84, 122, 255, 0.07);
  display: grid;
  gap: 4px;
}

.comment-record-summary b {
  color: var(--ink);
  font-size: 14px;
}

.comment-record-summary span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.comment-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.history-record-summary {
  background:
    linear-gradient(135deg, rgba(84, 122, 255, 0.08), rgba(50, 197, 255, 0.08)),
    rgba(255, 255, 255, 0.72);
}

.history-timeline {
  position: relative;
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 2px 2px 2px 8px;
}

.history-timeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: rgba(134, 152, 185, 0.16);
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.history-item > i {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin: 13px auto 0;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 1px rgba(84, 122, 255, 0.22);
}

.history-item > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  gap: 6px;
}

.history-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.history-item header > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-restore-btn {
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
  white-space: nowrap;
}

.history-item b,
.history-item small,
.history-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item b {
  color: var(--ink);
  font-size: 13px;
}

.history-item small,
.history-item span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.history-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.history-change-list {
  display: grid;
  gap: 6px;
}

.history-change-item {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(134, 152, 185, 0.14);
  border-radius: 10px;
  background: rgba(247, 250, 255, 0.72);
  display: grid;
  grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.history-change-item b,
.history-change-item span,
.history-change-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-change-item b {
  color: var(--muted);
  font-size: 12px;
}

.history-change-item span {
  color: var(--subtle);
  font-size: 12px;
  text-decoration: line-through;
}

.history-change-item i {
  color: var(--blue);
  font-style: normal;
  font-weight: 900;
}

.history-change-item strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 860;
}

.history-comment > i {
  background: var(--aqua);
}

.history-review > i {
  background: var(--success);
}

.history-edit > i {
  background: var(--warning);
}

.confirm-modal {
  width: min(520px, calc(100vw - 28px));
}

.confirm-message {
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 14px;
  background: rgba(247, 250, 255, 0.76);
  display: grid;
  gap: 5px;
}

.confirm-message b {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.confirm-message p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.confirm-item-list {
  display: grid;
  gap: 6px;
}

.confirm-item-list span,
.confirm-item-list em {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.confirm-warning .confirm-message {
  border-color: rgba(255, 152, 84, 0.24);
  background: rgba(255, 247, 237, 0.72);
}

.confirm-danger .confirm-message {
  border-color: rgba(239, 91, 91, 0.26);
  background: rgba(255, 241, 242, 0.72);
}

.danger-confirm {
  background: linear-gradient(135deg, #e5484d, #ff7a59) !important;
  box-shadow: 0 12px 28px rgba(229, 72, 77, 0.22) !important;
}

.history-danger > i {
  background: var(--danger);
}

.comment-item {
  padding: 11px 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 7px;
}

.comment-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-item b {
  color: var(--ink);
  font-size: 13px;
}

.comment-item span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.comment-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.comment-mentions,
.mention-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.comment-mentions span,
.mention-hints > span,
.mention-chip {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(84, 122, 255, 0.14);
  border-radius: 999px;
  background: rgba(84, 122, 255, 0.08);
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 760;
}

.mention-hints > span {
  color: var(--subtle);
  background: transparent;
  border-color: transparent;
  padding-left: 0;
}

.mention-chip {
  cursor: pointer;
}

.mention-chip:hover {
  border-color: rgba(84, 122, 255, 0.28);
  background: rgba(84, 122, 255, 0.14);
}

.comment-input {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.drilldown-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.drilldown-scope-bar {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 14px;
  background: rgba(247, 250, 255, 0.74);
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.drilldown-scope-bar b {
  color: var(--ink);
  font-size: 14px;
}

.drilldown-scope-bar small {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.drilldown-scope-bar div {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.drilldown-scope-bar span {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(84, 122, 255, 0.1);
  color: var(--blue-deep);
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 820;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.drilldown-summary article {
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  align-content: space-between;
}

.drilldown-summary span,
.drilldown-card-head span,
.drilldown-row small {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.drilldown-summary b {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

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

.drilldown-card {
  min-height: 270px;
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.drilldown-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drilldown-card-head b {
  color: var(--ink);
  font-size: 14px;
}

.drilldown-list {
  display: grid;
  gap: 6px;
}

.drilldown-row {
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.78);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.drilldown-row span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.drilldown-row b {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drilldown-row strong {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.drilldown-row small {
  grid-column: 2 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-scope-note {
  padding: 11px 12px;
  border: 1px solid rgba(84, 122, 255, 0.16);
  border-radius: 13px;
  background: rgba(84, 122, 255, 0.07);
  display: grid;
  gap: 3px;
}

.target-scope-note b {
  color: var(--ink);
  font-size: 13px;
}

.dashboard-alerts article {
  padding: 11px 13px;
  border: 1px solid rgba(239, 91, 91, 0.22);
  border-radius: 12px;
  background: rgba(255, 247, 247, 0.86);
  display: grid;
  gap: 3px;
}

.dashboard-alerts article.severity-medium,
.dashboard-alerts article.severity-low {
  border-color: rgba(255, 152, 84, 0.28);
  background: rgba(255, 250, 242, 0.88);
}

.dashboard-alerts b {
  color: #c94a4a;
}

.dashboard-alerts article.severity-medium b,
.dashboard-alerts article.severity-low b {
  color: #9a4b13;
}

.dashboard-alerts span,
.filing-reminder span {
  color: var(--muted);
  font-size: 12px;
}

.chart-modal {
  width: min(1120px, calc(100vw - 32px));
}

.chart-modal .daily-chart {
  min-height: 420px;
}

.filing-reminder {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drop-hint {
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px dashed rgba(126, 85, 255, 0.24);
  border-radius: 12px;
  color: var(--subtle);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.record-panel.is-dragover {
  outline: 2px solid rgba(126, 85, 255, 0.34);
  outline-offset: 3px;
}

.org-admin-console {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 76px;
}

.org-tree-panel {
  padding: 14px !important;
  position: sticky;
  top: 12px;
}

.org-tree-title {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  min-width: 0;
}

.org-tree-title h3 {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 16px;
  line-height: 1.25;
  min-width: 0;
}

.org-tree-title span,
.org-scope-card span,
.org-tree-node small {
  color: var(--subtle);
  font-size: 12px;
}

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

.org-tree-node {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  align-content: center;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
  min-height: 58px;
}

.org-tree-node span {
  font-weight: 780;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-tree-title span,
.org-scope-card span,
.org-tree-node small {
  min-width: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-tree-node small {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  white-space: normal;
  max-height: none;
  overflow-wrap: anywhere;
}

.org-tree-node small em,
.org-tree-node small b {
  min-width: 0;
  font-style: normal;
  font-weight: 780;
  line-height: 1.3;
}

.org-tree-node small em {
  flex: 0 0 auto;
}

.org-tree-node small b {
  color: inherit;
  overflow-wrap: anywhere;
}

.org-tree-node.is-empty small {
  color: rgba(100, 116, 139, 0.82);
}

.org-tree-node:hover,
.org-tree-node.active {
  background: rgba(84, 122, 255, 0.08);
  border-color: rgba(113, 92, 255, 0.18);
}

.org-tree-node.active {
  box-shadow: inset 3px 0 0 var(--violet);
}

.org-scope-card {
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  gap: 4px;
}

.org-admin-workspace {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.org-task-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
}

.org-task-card {
  min-height: 104px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 16px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-items: center;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.org-task-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue);
}

.org-task-card:hover {
  transform: translateY(-1px);
  border-color: rgba(84, 122, 255, 0.22);
  box-shadow: 0 16px 32px rgba(42, 64, 110, 0.11);
}

.org-task-card:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.org-task-card .task-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(84, 122, 255, 0.1);
  color: var(--blue);
}

.org-task-card .task-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.org-task-card .task-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.org-task-card .task-body b {
  color: var(--ink);
  font-size: 23px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow-wrap: anywhere;
}

.org-task-card .task-body small,
.org-task-card .task-meta {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.org-task-card .task-meta {
  grid-column: 1 / -1;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-pending::before {
  background: var(--warning);
}

.task-create::before {
  background: var(--blue);
}

.task-alert::before {
  background: var(--danger);
}

.task-insight::before {
  background: var(--success);
}

.task-backup::before {
  background: var(--aqua);
}

.task-pending .task-icon {
  color: #b85a10;
  background: rgba(255, 152, 84, 0.12);
}

.task-create .task-icon {
  color: var(--blue);
  background: rgba(84, 122, 255, 0.1);
}

.task-alert .task-icon {
  color: #b92f42;
  background: rgba(239, 91, 91, 0.12);
}

.task-insight .task-icon {
  color: #227d5c;
  background: rgba(54, 199, 134, 0.12);
}

.task-backup .task-icon {
  color: #0b7792;
  background: rgba(50, 197, 255, 0.12);
}

.section-pulse {
  animation: sectionPulse 980ms ease both;
}

.org-tools-panel {
  padding: 12px !important;
  display: grid;
  gap: 10px;
}

.org-filter-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.org-filter-tabs button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 10px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}

.org-filter-tabs button:hover {
  border-color: rgba(84, 122, 255, 0.24);
  background: rgba(84, 122, 255, 0.07);
}

.org-filter-tabs button.active {
  color: var(--blue-deep);
  border-color: rgba(84, 122, 255, 0.28);
  background: rgba(84, 122, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(84, 122, 255, 0.08);
}

.org-filter-tabs span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-filter-tabs b {
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  background: rgba(134, 152, 185, 0.12);
  display: inline-grid;
  place-items: center;
  color: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.org-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.org-search-row .row-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.org-batch-bar {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 24;
  max-width: min(860px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 52px rgba(42, 64, 110, 0.16);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.org-batch-bar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.org-batch-bar b {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.org-batch-bar span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.org-batch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.org-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}

.org-summary-grid article {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  display: grid;
  align-content: space-between;
  min-width: 0;
}

.org-summary-grid article.needs-attention {
  border-color: rgba(255, 152, 84, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 247, 237, 0.74)),
    rgba(255, 255, 255, 0.76);
}

.org-summary-grid span,
.org-summary-grid small {
  color: var(--subtle);
  font-size: 12px;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.org-summary-grid b {
  font-size: 24px;
  color: var(--ink);
  line-height: 1.12;
  min-width: 0;
  overflow-wrap: anywhere;
}

.org-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px;
}

.org-insight-card {
  min-height: 178px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
  display: grid;
  align-content: start;
  gap: 10px;
}

.insight-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.insight-card-head b {
  color: var(--ink);
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-card-head span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  flex: 0 0 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.role-distribution,
.branch-bars,
.anomaly-list {
  display: grid;
  gap: 8px;
}

.insight-bar,
.branch-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "bar bar";
  gap: 6px 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  min-width: 0;
  min-height: 36px;
}

.insight-bar span,
.branch-bar span,
.insight-bar strong,
.branch-bar strong {
  min-width: 0;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}

.insight-bar span,
.branch-bar span {
  grid-area: label;
}

.insight-bar strong,
.branch-bar strong {
  grid-area: value;
  text-align: right;
  white-space: nowrap;
}

.insight-bar i,
.branch-bar i {
  grid-area: bar;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(134, 152, 185, 0.14);
  overflow: hidden;
}

.insight-bar b,
.branch-bar b {
  height: 100%;
  border-radius: inherit;
  display: block;
  background: linear-gradient(90deg, var(--blue), var(--violet));
}

.item-gold b {
  background: linear-gradient(90deg, #ffc857, #ff9854);
}

.item-green b {
  background: linear-gradient(90deg, #36c786, #73e0b4);
}

.item-aqua b {
  background: linear-gradient(90deg, #32c5ff, #5de4d2);
}

.item-pink b {
  background: linear-gradient(90deg, #ff7bb5, #a66cff);
}

.branch-bar {
  min-height: 38px;
}

.branch-bar.active {
  color: var(--ink);
}

.branch-bar.active span {
  font-weight: 880;
}

.branch-bar.active i {
  background: rgba(126, 85, 255, 0.16);
}

.anomaly-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(248, 251, 255, 0.72)),
    radial-gradient(circle at 95% 8%, rgba(239, 91, 91, 0.08), transparent 36%);
}

.anomaly-item {
  padding: 9px 10px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-left-width: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  display: grid;
  gap: 3px;
}

.anomaly-item b {
  color: var(--ink);
  font-size: 13px;
}

.anomaly-item span {
  color: var(--subtle);
  font-size: 12px;
}

.severity-high {
  border-left-color: var(--danger);
}

.severity-medium {
  border-left-color: var(--warning);
}

.severity-low {
  border-left-color: var(--blue);
}

.compact-empty {
  min-height: 92px;
}

.backup-panel {
  display: grid;
  gap: 12px;
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.backup-grid article {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.68);
  display: grid;
  align-content: space-between;
}

.backup-grid span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.backup-grid b {
  color: var(--ink);
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.backup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.backup-restore-select {
  min-width: min(280px, 100%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.backup-restore-select span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.restore-preview-modal {
  width: min(760px, 96vw);
}

.restore-preview-hero {
  margin: 6px 0 14px;
  padding: 14px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(47, 125, 246, 0.1), rgba(32, 214, 189, 0.1)),
    rgba(255, 255, 255, 0.76);
  display: grid;
  gap: 5px;
  min-width: 0;
}

.restore-preview-hero b {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.restore-preview-hero span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.restore-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.restore-preview-card {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-width: 0;
}

.restore-preview-card span,
.restore-preview-card small {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
}

.restore-preview-card b {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.restore-preview-card.delta-up small {
  color: #07815c;
}

.restore-preview-card.delta-down small {
  color: #b42318;
}

.restore-preview-card.delta-same small {
  color: var(--subtle);
}

.backup-restore-select .select {
  min-width: 210px;
}

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

.approval-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.approval-head-actions span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.approval-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.75fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.audit-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow-x: hidden;
}

.audit-panel {
  overflow-x: hidden;
}

.audit-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.audit-head-actions span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.audit-list article {
  display: grid;
  grid-template-columns: minmax(86px, 0.35fr) minmax(0, 1fr) minmax(0, 0.42fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  min-width: 0;
  overflow: hidden;
}

.audit-list article > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-list span,
.audit-list small {
  color: var(--subtle);
  font-size: 12px;
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.audit-list b {
  min-width: 0;
}

.audit-modal {
  width: min(1080px, calc(100vw - 28px));
}

.audit-filter-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(220px, 1.2fr) minmax(96px, 0.5fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(178, 193, 214, 0.45);
  border-radius: 14px;
  background: rgba(249, 252, 255, 0.76);
}

.audit-search-field {
  min-width: 0;
}

.audit-modal-meta {
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.audit-modal-meta span,
.audit-modal-meta b {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 760;
  min-width: 0;
}

.audit-table-wrap {
  max-height: min(58vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.audit-table {
  width: 100%;
  min-width: 840px;
  border-collapse: separate;
  border-spacing: 0;
}

.audit-table th,
.audit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(178, 193, 214, 0.38);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.audit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--ink);
  font-weight: 840;
  background: rgba(248, 251, 255, 0.96);
}

.audit-table td {
  overflow-wrap: anywhere;
}

.audit-table td b {
  color: var(--ink);
  font-size: 12px;
}

.audit-table td small {
  margin-top: 2px;
  display: block;
  color: var(--subtle);
  font-size: 11px;
}

.org-member-table-wrap {
  max-height: none;
  max-width: 100%;
  overflow-x: auto;
}

.org-member-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 10px;
}

.org-member-card {
  padding: 12px;
  border: 1px solid rgba(134, 152, 185, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(248, 251, 255, 0.74)),
    rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 11px;
  min-width: 0;
  overflow: hidden;
}

.org-member-card:hover {
  border-color: rgba(84, 122, 255, 0.26);
  box-shadow: 0 16px 34px rgba(42, 64, 110, 0.11);
}

.org-member-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.org-member-card-head .member-cell {
  align-items: flex-start;
  flex: 1 1 auto;
  min-width: 0;
}

.org-member-card-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  min-width: max-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.org-edit-toggle {
  min-width: 58px;
}

.org-member-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  gap: 6px;
}

.org-member-card-meta span {
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(134, 152, 185, 0.14);
  border-radius: 10px;
  background: rgba(247, 250, 255, 0.72);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
}

.org-member-card-meta .ui-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--blue);
}

.org-member-card-meta span {
  white-space: normal;
  overflow-wrap: anywhere;
}

.org-member-card-editor {
  padding: 10px;
  border: 1px solid rgba(84, 122, 255, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(242, 247, 255, 0.7)),
    rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 10px;
  min-width: 0;
}

.org-member-card.is-expanded {
  border-color: rgba(84, 122, 255, 0.28);
  box-shadow: 0 16px 34px rgba(42, 64, 110, 0.12);
}

.org-member-card.is-saving {
  opacity: 0.86;
}

.org-user-feedback {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 10px;
  background: rgba(247, 250, 255, 0.76);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.3;
  min-width: 0;
}

.org-user-feedback i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.org-user-feedback span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.org-user-feedback.feedback-saving {
  color: #1556cf;
  background: rgba(47, 125, 246, 0.1);
}

.org-user-feedback.feedback-success {
  color: #227d5c;
  background: rgba(54, 199, 134, 0.12);
}

.org-user-feedback.feedback-error {
  color: #b42318;
  background: rgba(239, 91, 91, 0.12);
}

.org-member-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.org-member-card-grid .input,
.org-member-card-grid .select {
  width: 100%;
  min-width: 0;
}

.org-member-card .permission-chips {
  max-width: none;
}

.org-member-card .permission-matrix {
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
}

.org-member-card .row-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.org-member-table-details {
  margin-top: 12px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
  overflow: hidden;
}

.org-member-table-details summary {
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 840;
  list-style: none;
}

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

.org-member-table-details summary::after {
  content: "展开";
  margin-left: auto;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(84, 122, 255, 0.1);
  color: var(--blue-deep);
  display: inline-flex;
  align-items: center;
  font-size: 11px;
}

.org-member-table-details[open] summary::after {
  content: "收起";
}

.org-member-table-details .org-member-table-wrap {
  border-radius: 0;
  border-width: 1px 0 0;
}

.org-member-table-details:not([open]) .org-member-table-wrap {
  display: none;
}

.org-member-table {
  min-width: 1280px !important;
  table-layout: fixed;
}

.org-member-table th,
.org-member-table td {
  vertical-align: middle;
  overflow: hidden;
}

.org-member-table th:nth-child(1),
.org-member-table td:nth-child(1) {
  width: 330px;
}

.org-member-table th:nth-child(2),
.org-member-table td:nth-child(2) {
  width: 120px;
}

.org-member-table th:nth-child(3),
.org-member-table td:nth-child(3) {
  width: 190px;
}

.org-member-table th:nth-child(4),
.org-member-table td:nth-child(4) {
  width: 170px;
}

.org-member-table th:nth-child(5),
.org-member-table td:nth-child(5) {
  width: 330px;
}

.org-member-table th:nth-child(6),
.org-member-table td:nth-child(6) {
  width: 180px;
  background: rgba(255, 255, 255, 0.94);
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-cell > div {
  min-width: 0;
  flex: 1 1 auto;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 860;
  background: var(--candy-gradient);
  box-shadow: 0 10px 22px rgba(126, 85, 255, 0.2);
}

.member-cell b {
  display: block;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.28;
}

.member-cell small {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.account-status-row {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

.account-status-row.is-compact {
  margin-top: 6px;
}

.account-status-pill {
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #2f7d5c;
  background: rgba(54, 199, 134, 0.12);
  font-size: 11px;
  font-weight: 840;
  line-height: 1;
  white-space: nowrap;
}

.account-status-pill.needs-password,
.status-pill.needs-password {
  color: #9a4b13;
  background: rgba(255, 152, 84, 0.15);
}

.account-status-pill.is-disabled {
  color: var(--subtle);
  background: rgba(148, 163, 184, 0.14);
}

.account-status-pill.is-safe {
  color: #2f7d5c;
  background: rgba(54, 199, 134, 0.12);
}

.member-name-input {
  min-width: 0;
  width: 100%;
  height: 34px;
}

.permission-chips {
  width: 100%;
  max-width: 310px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.permission-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.permission-cell {
  min-width: 0;
  min-height: 32px;
  padding: 4px 5px;
  border: 1px solid rgba(134, 152, 185, 0.16);
  border-radius: 9px;
  background: rgba(247, 250, 255, 0.74);
  color: var(--subtle);
  display: grid;
  grid-template-columns: 13px minmax(28px, 1fr) 12px;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1.15;
}

.permission-cell .ui-icon {
  width: 13px;
  height: 13px;
  color: currentColor;
}

.permission-cell b {
  min-width: 0;
  color: inherit;
  font-size: 11px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-cell i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--subtle);
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.permission-cell.is-on {
  border-color: rgba(84, 122, 255, 0.24);
  background: linear-gradient(145deg, rgba(84, 122, 255, 0.11), rgba(50, 197, 255, 0.08));
  color: var(--blue-deep);
}

.permission-cell.is-on i {
  background: var(--blue);
  color: #fff;
}

.permission-scope {
  min-width: 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.status-pill {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #2f7d5c;
  background: rgba(54, 199, 134, 0.12);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 820;
  flex: 0 0 auto;
  white-space: nowrap;
}

.status-pill.is-disabled {
  color: var(--subtle);
  background: rgba(148, 163, 184, 0.14);
}

.org-member-table td:nth-child(2) b {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-member-table .select.table-input {
  width: 100%;
  min-width: 0;
}

.org-member-table .row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.create-account-panel .account-create-grid {
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  align-items: end;
}

.create-account-panel .account-create-grid .mini-filter,
.create-account-panel .account-create-grid .input,
.create-account-panel .account-create-grid .select {
  min-width: 0;
}

.create-account-panel .account-create-grid .btn {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .org-admin-console {
    grid-template-columns: 1fr;
  }

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

  .org-tree-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-task-hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .org-filter-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .branch-structure-grid {
    grid-template-columns: 1fr;
  }

  .hq-structure {
    grid-template-columns: 1fr;
  }

  .hq-structure > i {
    width: 2px;
    height: 18px;
    justify-self: center;
    background: linear-gradient(180deg, var(--blue), var(--violet), var(--aqua));
  }

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

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

  .drilldown-grid {
    grid-template-columns: 1fr;
  }

  .org-insight-grid {
    grid-template-columns: 1fr;
  }

  .audit-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-queue-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .approval-item,
  .org-search-row,
  .create-account-panel .account-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .org-tree-list,
  .org-task-hub,
  .org-filter-tabs,
  .org-summary-grid,
  .target-progress-grid,
  .drilldown-summary,
  .drilldown-scope-bar,
  .approval-item,
  .org-search-row,
  .create-account-panel .account-create-grid {
    grid-template-columns: 1fr;
  }

  .approval-item {
    align-items: stretch;
  }

  .drilldown-scope-bar div {
    justify-content: flex-start;
  }

  .org-architecture-panel .panel-head {
    align-items: flex-start;
  }

  .chain-row,
  .frontline-groups {
    grid-template-columns: 1fr;
  }

  .org-node,
  .frontline-group {
    min-height: auto;
  }

  .org-node-people,
  .frontline-group div {
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
  }

  .branch-bar,
  .insight-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label value"
      "bar bar";
    gap: 6px 8px;
  }

  .branch-bar strong,
  .insight-bar strong {
    font-size: 11px;
  }

  .approval-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .filing-reminder {
    align-items: stretch;
    flex-direction: column;
  }

  .record-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .record-page-controls {
    justify-content: space-between;
  }

  .record-keyboard-bar,
  .record-keyboard-current {
    grid-template-columns: 1fr;
  }

  .record-keyboard-actions {
    justify-content: flex-start;
  }

  .record-keyboard-actions .btn {
    flex: 1 1 calc(50% - 6px);
  }

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

  .audit-head-actions,
  .audit-modal-meta {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .review-queue-filters {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    width: 100%;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-queue-summary,
  .review-queue-item {
    grid-template-columns: 1fr;
  }

  .review-queue-main {
    align-items: flex-start;
  }

  .history-item header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .history-item header > div {
    width: 100%;
  }

  .org-member-table-wrap {
    display: block;
  }

  .org-member-card-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .org-member-card {
    gap: 10px;
  }

  .org-member-card-meta,
  .org-member-card-grid {
    grid-template-columns: 1fr;
  }

  .org-member-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .org-member-card-head-actions {
    justify-content: space-between;
    width: 100%;
  }

  .org-member-card .permission-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-member-card .row-actions {
    justify-content: flex-start;
  }

  .org-batch-bar {
    bottom: calc(74px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .org-batch-actions {
    justify-content: flex-start;
  }

  .org-batch-actions .btn {
    flex: 1 1 calc(50% - 7px);
  }

  .backup-grid,
  .backup-actions,
  .restore-preview-grid {
    grid-template-columns: 1fr;
  }

  .backup-actions {
    flex-direction: column;
  }

  .backup-restore-select,
  .backup-restore-select .select,
  .backup-actions .btn {
    width: 100%;
  }

  .smart-suggestion-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .smart-suggestion-panel > div:first-child,
  .suggestion-overview,
  .suggestion-chips,
  .suggestion-confidence,
  .smart-suggestion-panel .btn {
    grid-column: auto;
    grid-row: auto;
  }

  .record-form-assist {
    grid-template-columns: 1fr;
  }

  .record-form-assist span {
    white-space: normal;
  }

  .smart-suggestion-panel .btn {
    width: 100%;
  }

  .comment-item div {
    align-items: flex-start;
    flex-direction: column;
  }

  .notification-backdrop {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    padding: 10px;
  }

  .notification-drawer {
    width: calc(100vw - 20px) !important;
    max-width: none;
    min-height: min(620px, calc(100vh - 20px));
  }

  .notification-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .browser-notification-setting {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .browser-notification-setting .btn {
    width: 100%;
  }
}

/* Daily filing coverage cockpit. */
.coverage-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(130, 145, 180, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(47, 125, 246, 0.1), rgba(32, 214, 189, 0.08)),
    rgba(255, 255, 255, 0.72);
}

.coverage-summary.has-missing {
  background:
    linear-gradient(135deg, rgba(255, 152, 84, 0.16), rgba(239, 91, 91, 0.08)),
    rgba(255, 255, 255, 0.76);
}

.coverage-summary span,
.coverage-summary small {
  color: var(--muted);
  font-size: 12px;
}

.coverage-summary b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.coverage-summary strong {
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.coverage-summary small {
  grid-column: 1 / -1;
}

.count-tile {
  position: relative;
  overflow: hidden;
}

.count-tile.has-missing {
  border-color: rgba(255, 152, 84, 0.34) !important;
  background: rgba(255, 248, 241, 0.86) !important;
}

.count-tile i,
.missing-type-card i {
  display: block;
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(130, 145, 180, 0.16);
}

.count-tile i em,
.missing-type-card i em {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f7df6, #20d6bd);
}

.count-tile.has-missing i em,
.missing-type-card.has-missing i em {
  background: linear-gradient(90deg, #ff9854, #ef5b5b);
}

.missing-modal {
  max-width: 980px;
}

.missing-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.missing-type-grid,
.missing-branch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.missing-type-card,
.missing-branch-card,
.missing-person-row {
  border: 1px solid rgba(130, 145, 180, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(35, 52, 78, 0.06);
}

.missing-type-card {
  padding: 12px;
}

.missing-type-card.has-missing,
.missing-branch-card.has-missing {
  border-color: rgba(255, 152, 84, 0.3);
  background: rgba(255, 248, 241, 0.86);
}

.missing-type-card div,
.missing-branch-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.missing-type-card span,
.missing-type-card small,
.missing-branch-card span,
.missing-branch-card small,
.missing-person-row small {
  color: var(--muted);
  font-size: 12px;
}

.missing-type-card b,
.missing-branch-card strong {
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.missing-branch-section,
.missing-list-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.missing-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.missing-tools .segmented-control {
  min-width: 0;
}

.missing-branch-card {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.missing-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(360px, 42vh);
  overflow: auto;
  padding-right: 2px;
}

.missing-person-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.missing-person-row b,
.missing-person-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-history-panel {
  overflow: hidden;
}

.target-history-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  align-items: stretch;
}

.target-history-main {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(130, 145, 180, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(126, 85, 255, 0.1), rgba(32, 214, 189, 0.08)),
    rgba(255, 255, 255, 0.76);
}

.target-history-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.target-history-kpis article {
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.target-history-kpis span,
.target-history-kpis small,
.target-history-month span,
.target-history-month small {
  color: var(--muted);
  font-size: 12px;
}

.target-history-kpis b {
  display: block;
  margin: 2px 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.target-history-chart {
  width: 100%;
  min-height: 116px;
}

.target-history-goal {
  stroke: rgba(54, 199, 134, 0.42);
  stroke-dasharray: 5 5;
}

.target-history-area {
  fill: url(#targetHistoryArea);
}

.target-history-line {
  fill: none;
  stroke: #7e55ff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.target-history-dot {
  fill: #fff;
  stroke: #7e55ff;
  stroke-width: 3;
}

.target-history-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.target-history-month {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(130, 145, 180, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.target-history-month div {
  min-width: 0;
}

.target-history-month b,
.target-history-month span,
.target-history-month small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-history-month strong {
  color: var(--ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.target-history-month.status-achieved {
  border-color: rgba(54, 199, 134, 0.28);
}

.target-history-month.status-on_track {
  border-color: rgba(47, 125, 246, 0.24);
}

.target-history-month.status-behind {
  border-color: rgba(255, 152, 84, 0.3);
  background: rgba(255, 248, 241, 0.84);
}

.system-status-stack {
  display: grid;
  gap: 8px;
  margin-top: -4px;
}

.system-status-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(130, 145, 180, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(35, 52, 78, 0.06);
}

.system-status-banner div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.system-status-banner b {
  color: var(--ink);
  font-size: 13px;
}

.system-status-banner span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.system-status-banner.status-danger {
  border-color: rgba(239, 91, 91, 0.28);
  background: rgba(255, 245, 245, 0.86);
}

.system-status-banner.status-warning {
  border-color: rgba(255, 152, 84, 0.3);
  background: rgba(255, 248, 241, 0.86);
}

.system-status-banner.status-info {
  border-color: rgba(47, 125, 246, 0.22);
  background: rgba(245, 249, 255, 0.88);
}

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

@media (max-width: 980px) {
  .missing-summary,
  .missing-type-grid,
  .missing-branch-grid,
  .target-history-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .target-history-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .coverage-summary,
  .missing-summary,
  .missing-type-grid,
  .missing-branch-grid,
  .missing-list,
  .target-history-kpis {
    grid-template-columns: 1fr;
  }

  .missing-modal {
    max-width: none;
  }

  .missing-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .missing-tools .btn {
    width: 100%;
  }

  .system-status-banner {
    grid-template-columns: 1fr;
  }

  .system-status-actions {
    justify-content: stretch;
  }

  .system-status-actions .btn {
    flex: 1;
  }
}

/* Unified H5 refinement: mobile-first overrides for 320-430px business use. */
.mobile-primary-action {
  display: none;
}

@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;
  }

  *,
  *::before,
  *::after {
    min-width: 0;
  }

  .app-shell {
    display: block !important;
    width: 100%;
    max-width: 100vw;
    min-height: 100dvh;
    padding: 10px 10px calc(150px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden;
  }

  .login-page {
    min-height: 100dvh;
    padding: 10px !important;
    grid-template-columns: 1fr !important;
    align-content: center;
  }

  .login-panel,
  .login-aside-inner,
  .topbar,
  .panel,
  .system-status-banner,
  .record-card,
  .org-member-card,
  .notification-drawer {
    border-radius: 18px !important;
    box-shadow: 0 10px 26px rgba(52, 94, 133, 0.08) !important;
  }

  .sidebar {
    display: none !important;
  }

  .main,
  .content {
    width: 100%;
    max-width: 100%;
    gap: 10px !important;
    overflow-x: hidden;
  }

  .topbar {
    position: static !important;
    top: auto !important;
    min-height: auto !important;
    padding: 12px !important;
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .topbar h2 {
    font-size: 22px !important;
    line-height: 1.15;
  }

  .topbar p {
    margin-top: 3px;
    font-size: 12px;
  }

  .topbar h2 .ui-icon {
    width: 22px;
    height: 22px;
  }

  .top-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: stretch;
  }

  .top-actions > * {
    width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
  }

  .top-actions .btn,
  .top-actions .select,
  .top-actions .input,
  .top-actions .badge {
    min-height: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 13px;
  }

  .top-action-refresh,
  .notification-button {
    padding: 0 !important;
    font-size: 0 !important;
  }

  .top-action-refresh .ui-icon,
  .notification-button .ui-icon {
    width: 20px;
    height: 20px;
  }

  .top-actions > .select[data-action="branch-filter"],
  .top-actions > .badge.teal {
    grid-column: 2 / 4;
  }

  .top-actions > .offline-sync-button,
  .top-actions > .compact-date {
    grid-column: 1 / -1;
  }

  .top-action-export,
  .desktop-primary-action {
    display: none !important;
  }

  .mobile-primary-action {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 95;
    min-height: 48px;
    border-radius: 16px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 42px rgba(126, 85, 255, 0.28);
  }

  .system-status-stack {
    margin-top: 0;
    gap: 8px;
  }

  .system-status-banner {
    grid-template-columns: 1fr !important;
    gap: 10px;
    padding: 10px !important;
  }

  .system-status-banner span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .system-status-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .system-status-actions .btn {
    width: 100%;
    min-height: 40px;
  }

  .panel-head {
    align-items: flex-start;
    gap: 6px;
  }

  .panel-head h3 {
    font-size: 18px;
    line-height: 1.2;
  }

  .panel-head > span {
    width: 100%;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
  }

  .record-panel {
    padding: 12px !important;
  }

  .record-tools {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .record-quick-filters {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .record-search-input {
    grid-column: 1 / -1;
  }

  .record-quick-filters .input,
  .record-quick-filters .btn,
  .filter-grid .input,
  .filter-grid .select,
  .mini-filter .input,
  .mini-filter .select {
    min-height: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 16px;
  }

  .record-date-presets {
    display: flex !important;
    width: calc(100vw - 44px);
    max-width: 100%;
    gap: 7px;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding: 0 0 2px;
    scrollbar-width: none;
  }

  .record-date-presets::-webkit-scrollbar {
    display: none;
  }

  .record-date-presets button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
  }

  .record-filter-details {
    border: 1px solid rgba(134, 152, 185, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    overflow: hidden;
  }

  .record-filter-details summary {
    min-height: 44px;
    padding: 0 12px;
    color: var(--blue-deep);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 820;
    list-style: none;
    cursor: pointer;
  }

  .record-filter-details summary::-webkit-details-marker {
    display: none;
  }

  .record-filter-details summary::after {
    content: "展开";
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
  }

  .record-filter-details[open] summary::after {
    content: "收起";
  }

  .record-filter-body {
    display: grid;
    gap: 10px;
    padding: 0 10px 10px;
  }

  .table-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  .table-actions .btn {
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    font-size: 12px;
  }

  .drop-hint {
    display: none !important;
  }

  .filter-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px;
    margin-top: 0;
  }

  .filter-chips {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    margin-top: 0;
    scrollbar-width: none;
  }

  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .filter-chips button {
    flex: 0 0 auto;
  }

  .record-keyboard-bar {
    display: none !important;
  }

  .record-quality-bar,
  .filing-reminder,
  .record-pagination {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 8px;
  }

  .record-quality-counts,
  .record-page-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .base-table-wrap {
    display: none !important;
  }

  .record-card-list {
    display: grid !important;
    gap: 10px;
  }

  .record-card {
    padding: 12px !important;
  }

  .record-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .record-card-header b,
  .record-card-header strong,
  .record-card-header span {
    overflow-wrap: anywhere;
  }

  .record-card-header strong {
    font-size: 12px;
    white-space: nowrap;
  }

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

  .record-card-metric {
    min-height: 54px;
    padding: 9px;
  }

  .record-card-metric b {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .record-card-actions,
  .row-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .record-alert-tags {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .review-status {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .record-card-actions .btn,
  .row-actions .btn,
  .mini-btn {
    min-height: 38px;
    padding: 0 8px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dashboard-grid,
  .dashboard-grid-3,
  .comparison-grid,
  .branch-card-grid,
  .daily-trend-grid,
  .daily-trend-body,
  .daily-trend-metrics,
  .grid-2,
  .org-admin-console,
  .org-task-hub,
  .org-summary-grid,
  .org-insight-grid,
  .org-tree-list,
  .branch-structure-grid,
  .hq-structure,
  .frontline-groups,
  .target-progress-grid,
  .drilldown-grid,
  .backup-grid {
    grid-template-columns: 1fr !important;
  }

  .kpi-grid,
  .coverage-summary {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .kpi-grid::-webkit-scrollbar,
  .coverage-summary::-webkit-scrollbar {
    display: none;
  }

  .kpi,
  .coverage-summary > * {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }

  .trend-chart,
  .daily-chart,
  .table-wrap,
  .org-member-table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .org-member-table-wrap {
    display: none !important;
  }

  .org-member-card-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .org-batch-bar {
    left: 10px;
    right: 10px;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    width: auto;
    grid-template-columns: 1fr !important;
  }

  .modal-backdrop {
    position: fixed;
    inset: 0;
    align-items: stretch !important;
    padding: 0 !important;
  }

  .modal,
  .chart-modal,
  .target-modal,
  .drilldown-modal,
  .comments-modal,
  .history-modal,
  .review-modal,
  .audit-modal,
  .import-modal,
  .restore-preview-modal,
  .missing-modal,
  .confirm-modal {
    width: 100% !important;
    max-width: none !important;
    min-height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
  }

  .modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px !important;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .modal-head h3 {
    font-size: 18px;
    line-height: 1.25;
  }

  .modal-body,
  .record-detail-grid {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px !important;
    grid-template-columns: 1fr !important;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
    background: rgba(255, 255, 255, 0.94);
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .modal-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .form-section-grid,
  .record-form-assist,
  .smart-suggestion-panel,
  .suggestion-overview,
  .audit-filter-row,
  .review-queue-filters,
  .review-queue-summary,
  .review-queue-item,
  .missing-tools,
  .system-status-banner {
    grid-template-columns: 1fr !important;
  }

  .field,
  .input,
  .select,
  textarea {
    max-width: 100%;
  }

  .field .input,
  .field .select,
  .field textarea,
  .modal .input,
  .modal .select,
  .modal textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .notification-backdrop {
    padding: 10px !important;
  }

  .notification-drawer {
    width: calc(100vw - 20px) !important;
    min-height: min(680px, calc(100dvh - 20px)) !important;
  }

  .bottom-nav {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    z-index: 90;
    min-height: 66px;
    padding: 6px;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(58px, 1fr);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bottom-nav::-webkit-scrollbar {
    display: none;
  }

  .bottom-nav-item {
    min-height: 54px;
    white-space: nowrap;
  }
}

/* Heatmap polish placed after mobile overrides so narrow screens keep the fixed layout. */
@media (max-width: 980px) {
  .heatmap-shell {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .heatmap-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .heatmap-legend {
    grid-column: auto;
    justify-content: flex-start;
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .heatmap-panel {
    gap: 12px;
  }

  .heatmap-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .heatmap-stats article {
    min-height: 68px;
    padding: 11px;
  }

  .heatmap-stats b {
    font-size: 18px;
  }

  .heatmap-calendar {
    gap: 6px;
  }

  .heatmap-cell,
  .heatmap-cell.is-blank {
    aspect-ratio: 1;
    min-height: 0 !important;
    padding: 6px;
    place-items: center;
    text-align: center;
  }

  .heatmap-cell b {
    font-size: 13px;
  }

  .heatmap-cell span,
  .heatmap-cell small {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .heatmap-calendar {
    gap: 5px;
  }

  .heatmap-cell,
  .heatmap-cell.is-blank {
    border-radius: 7px;
    padding: 4px;
  }

  .heatmap-cell b {
    font-size: 12px;
  }

  .heatmap-legend {
    justify-content: center;
  }
}
