:root {
  --navy: #080943;
  --navy-2: #17195b;
  --blue: #2589b7;
  --sky: #e8f6fa;
  --coral: #f36f5f;
  --coral-soft: #fff0ed;
  --gold: #f2c75c;
  --gold-soft: #fff8df;
  --mint: #95d4c2;
  --mint-soft: #eaf8f4;
  --ink: #16182b;
  --muted: #687085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f5f7f8;
  --danger: #cf4c41;
  --success: #247b63;
  --sidebar-width: 236px;
  --topbar-height: 76px;
  --shadow: 0 12px 28px rgba(21, 29, 50, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-size: 14px;
}

body.no-scroll {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
  background: linear-gradient(118deg, var(--navy) 0 38%, #eef4f6 38% 100%);
}

.auth-panel {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(8, 9, 67, 0.2);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 34px;
}

.auth-brand > span:last-child {
  display: grid;
  gap: 2px;
}

.auth-brand strong {
  color: var(--navy);
  font-size: 18px;
}

.auth-brand small {
  color: var(--muted);
  font-size: 11px;
}

.auth-copy p {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.auth-copy h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.auth-copy > span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #343a4c;
  font-size: 12px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  outline: 0;
}

.auth-form input:focus {
  border-color: #74bddb;
  box-shadow: 0 0 0 3px rgba(37, 137, 183, 0.1);
}

.auth-form .button {
  width: 100%;
  min-height: 44px;
}

.auth-error {
  min-height: 18px;
  margin: -4px 0;
  color: var(--danger);
  font-size: 11px;
}

.demo-account {
  display: block;
  margin-top: 18px;
  color: #9198a6;
  font-size: 10px;
  text-align: center;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  text-decoration: none;
}

button {
  border: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 137, 183, 0.24);
  outline-offset: 2px;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  color: #f4f7ff;
  background: var(--navy);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #ffffff;
}

.admin-brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  color: var(--navy);
  background: transparent;
  object-fit: contain;
  font-size: 20px;
  font-weight: 950;
}

.admin-brand > span:last-child {
  display: grid;
  gap: 2px;
}

.admin-brand strong {
  font-size: 17px;
  line-height: 1;
}

.admin-brand small {
  color: rgba(244, 247, 255, 0.57);
  font-size: 11px;
}

.sidebar-close {
  display: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 18px 12px;
  overflow-y: auto;
}

.nav-label {
  margin: 18px 10px 8px;
  color: rgba(233, 247, 251, 0.42);
  font-size: 11px;
  font-weight: 700;
}

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

.nav-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  color: rgba(244, 247, 255, 0.72);
  background: transparent;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

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

.nav-item.is-active {
  color: #ffffff;
  background: rgba(68, 198, 238, 0.17);
  box-shadow: inset 3px 0 0 #44c6ee;
}

.nav-item b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 11px;
  color: var(--navy);
  background: var(--mint);
  font-size: 11px;
}

.nav-item b.nav-alert {
  color: #ffffff;
  background: var(--coral);
}

.sidebar-foot {
  padding: 14px 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.front-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: rgba(244, 247, 255, 0.74);
  font-weight: 700;
}

button.front-link {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.front-link:hover {
  color: #ffffff;
}

.support-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #7fe0b8;
  box-shadow: 0 0 0 4px rgba(127, 224, 184, 0.12);
}

.support-box div {
  display: grid;
  gap: 4px;
}

.support-box strong {
  font-size: 12px;
}

.support-box small {
  color: rgba(244, 247, 255, 0.47);
  font-size: 10px;
}

.workspace {
  min-width: 0;
  margin-left: var(--sidebar-width);
}

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

.topbar-left,
.topbar-actions,
.account-button,
.heading-actions,
.panel-head,
.list-toolbar,
.list-footer,
.segments,
.text-button,
.popover-head {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 14px;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
}

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

.topbar-actions {
  gap: 10px;
}

.menu-toggle {
  display: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 6px;
  color: var(--ink);
  background: #f3f5f7;
  cursor: pointer;
}

.icon-button:hover {
  background: #e9eef2;
}

.icon-button.sidebar-close,
.icon-button.menu-toggle {
  display: none;
}

.icon-button.small {
  width: 34px;
  height: 34px;
}

.global-search,
.table-search {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search svg,
.table-search svg {
  position: absolute;
  left: 12px;
  width: 17px;
  color: #7a8294;
  pointer-events: none;
}

.global-search input,
.table-search input {
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #f8f9fa;
  outline: 0;
}

.global-search input {
  width: 220px;
}

.global-search input:focus,
.table-search input:focus {
  border-color: #8acbe4;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 137, 183, 0.1);
}

.notification-wrap {
  position: relative;
}

.notification-button {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--line);
}

.notification-button > span {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--coral);
}

.notification-popover {
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 50;
  width: 360px;
  padding: 10px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(18, 27, 49, 0.16);
  transition: 160ms ease;
}

.notification-popover.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.popover-head {
  justify-content: space-between;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.popover-head button {
  color: var(--blue);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.notice-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  width: 100%;
  padding: 12px 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.notice-item:hover {
  background: #f7f9fa;
}

.notice-icon,
.activity-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.notice-icon svg,
.activity-mark svg {
  width: 16px;
}

.notice-item > span:last-child {
  display: grid;
  gap: 4px;
}

.notice-item small {
  color: var(--muted);
  font-size: 12px;
}

.notice-icon.coral,
.activity-mark.coral {
  color: var(--danger);
  background: var(--coral-soft);
}

.notice-icon.gold,
.activity-mark.gold {
  color: #8b6b10;
  background: var(--gold-soft);
}

.notice-icon.mint,
.activity-mark.mint {
  color: var(--success);
  background: var(--mint-soft);
}

.activity-mark.blue {
  color: #23749a;
  background: var(--sky);
}

.account-button {
  gap: 9px;
  padding: 3px 5px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.account-button:hover {
  background: #f4f6f7;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 900;
}

.avatar-navy {
  color: #ffffff;
  background: var(--navy-2);
}

.avatar-coral {
  color: #8c342d;
  background: #ffd6d1;
}

.avatar-mint {
  color: #1d6855;
  background: #ccebe2;
}

.avatar-gold {
  color: #72550b;
  background: #f9e7aa;
}

.avatar-blue {
  color: #1c6180;
  background: #cfeaf4;
}

.account-copy {
  display: grid;
  gap: 2px;
  min-width: 62px;
  text-align: left;
}

.account-copy strong {
  font-size: 13px;
}

.account-copy small {
  color: var(--muted);
  font-size: 11px;
}

.account-button > svg {
  width: 15px;
  color: var(--muted);
}

.content {
  width: 100%;
  max-width: 1600px;
  min-height: calc(100vh - var(--topbar-height));
  padding: 28px;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in 180ms ease;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.view-heading.compact {
  align-items: center;
}

.view-heading h2 {
  margin: 4px 0 0;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0;
}

.view-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.view-heading .date-line {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.heading-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

.button.primary {
  color: #ffffff;
  background: var(--coral);
  box-shadow: 0 7px 14px rgba(243, 111, 95, 0.18);
}

.button.primary:hover {
  background: #e76253;
}

.button.secondary {
  color: var(--navy);
  background: #ffffff;
  border: 1px solid var(--line);
}

.button.secondary:hover {
  background: #f9fafb;
}

.button.tertiary {
  color: var(--muted);
  background: #f0f2f4;
}

.attention-strip {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #efdda3;
  border-radius: 8px;
  background: var(--gold-soft);
}

.attention-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #80600b;
  background: var(--gold);
}

.attention-strip p {
  margin: 4px 0 0;
  color: #756944;
  font-size: 12px;
}

.attention-strip button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #624a08;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.metrics-panel,
.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metrics-panel article,
.report-summary article {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 20px 22px;
}

.metrics-panel article:not(:last-child)::after,
.report-summary article:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 0;
  width: 1px;
  height: 60%;
  background: var(--line);
}

.metrics-panel span,
.report-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metrics-panel strong,
.report-summary strong {
  font-size: 27px;
  line-height: 1;
  letter-spacing: 0;
}

.metrics-panel small,
.report-summary small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.metrics-panel small svg {
  width: 14px;
  height: 14px;
}

.positive {
  color: var(--success) !important;
}

.dashboard-grid,
.insight-grid,
.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.insight-grid,
.report-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
}

.panel,
.list-panel,
.settings-form,
.settings-nav {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel-head {
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  gap: 6px;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.text-button svg {
  width: 15px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid #edf0f2;
  text-align: left;
  vertical-align: middle;
}

th {
  height: 42px;
  color: #7b8291;
  background: #fafbfb;
  font-size: 11px;
  font-weight: 800;
}

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

tbody tr[data-row-id] {
  cursor: pointer;
}

tbody tr[data-row-id]:hover td {
  background: #fafcfc;
}

td {
  color: #394053;
  font-size: 13px;
}

td strong {
  color: var(--ink);
}

.cell-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cell-person .avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.cell-stack {
  display: grid;
  gap: 4px;
}

.cell-stack small {
  color: var(--muted);
  font-size: 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 800;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status.pending,
.status.follow {
  color: #9a6813;
  background: var(--gold-soft);
}

.status.scheduled,
.status.talking,
.status.active {
  color: #246c90;
  background: var(--sky);
}

.status.in-service,
.status.signed,
.status.available,
.status.completed {
  color: var(--success);
  background: var(--mint-soft);
}

.status.attention,
.status.paused {
  color: var(--danger);
  background: var(--coral-soft);
}

.row-action {
  width: 32px;
  height: 32px;
  color: #7e8491;
  background: transparent;
}

.row-action:hover {
  background: #eef2f4;
}

.task-list {
  padding: 6px 16px 12px;
}

.task-list label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f2;
  cursor: pointer;
}

.task-list label:last-child {
  border-bottom: 0;
}

.task-list input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--navy-2);
}

.task-list label > span {
  display: grid;
  gap: 5px;
}

.task-list strong {
  font-size: 12px;
}

.task-list small {
  color: var(--muted);
  font-size: 10px;
}

.task-list input:checked + span {
  opacity: 0.48;
  text-decoration: line-through;
}

.priority {
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 9px;
}

.priority.high {
  color: var(--danger);
  background: var(--coral-soft);
}

.priority.medium {
  color: #8b6510;
  background: var(--gold-soft);
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.legend i {
  width: 9px;
  height: 9px;
  margin-left: 6px;
  border-radius: 2px;
}

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

.legend-light {
  background: var(--mint);
}

.bar-chart,
.monthly-chart {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  height: 245px;
  padding: 28px 24px 18px;
  background-image: repeating-linear-gradient(to top, transparent 0 49px, #edf0f2 49px 50px);
}

.bar-group,
.month-bar {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 24px;
}

.bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 176px;
}

.bar-pair i,
.month-bar i {
  width: min(20px, 40%);
  min-height: 5px;
  border-radius: 4px 4px 1px 1px;
  background: var(--navy-2);
  transition: height 500ms ease;
}

.bar-pair i:last-child {
  background: var(--mint);
}

.bar-group span,
.month-bar span {
  color: var(--muted);
  font-size: 10px;
}

.activity-list {
  padding: 6px 18px 12px;
}

.activity-list > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f2;
}

.activity-list > div:last-child {
  border-bottom: 0;
}

.activity-list p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.activity-list strong {
  font-size: 12px;
}

.activity-list small,
.activity-list time {
  color: var(--muted);
  font-size: 10px;
}

.activity-list time {
  color: #a0a6b2;
}

.list-panel {
  overflow: hidden;
}

.list-toolbar {
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.segments {
  gap: 3px;
  padding: 3px;
  border-radius: 6px;
  background: #f1f3f5;
}

.segments button {
  min-height: 33px;
  padding: 0 12px;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.segments button.is-active {
  color: var(--navy);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(25, 32, 55, 0.08);
}

.segments span {
  margin-left: 3px;
}

.table-search input {
  width: 230px;
  background: #ffffff;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 18px;
}

.list-footer {
  justify-content: space-between;
  padding: 13px 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

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

.pager button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: #ffffff;
  font-size: 11px;
  cursor: pointer;
}

.pager button.is-current {
  color: #ffffff;
  border-color: var(--navy-2);
  background: var(--navy-2);
}

.pager button:disabled {
  opacity: 0.45;
  cursor: default;
}

.empty-state {
  height: 180px;
  color: var(--muted);
  text-align: center;
}

.report-summary {
  margin-bottom: 18px;
}

.period-select {
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.report-total {
  color: var(--navy-2);
  font-size: 12px;
  font-weight: 800;
}

.monthly-chart {
  gap: 24px;
  height: 290px;
  padding-top: 34px;
}

.month-bar {
  height: 230px;
}

.month-bar i {
  width: min(46px, 62%);
  background: var(--blue);
}

.month-bar.current i {
  background: var(--coral);
}

.month-bar strong {
  color: var(--ink);
  font-size: 11px;
}

.donut-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 290px;
  padding: 26px;
}

.donut {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--navy-2) 0 42%, var(--coral) 42% 70%, var(--mint) 70% 89%, var(--gold) 89% 100%);
}

.donut::before {
  content: "";
  grid-area: 1 / 1;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: #ffffff;
}

.donut span {
  z-index: 1;
  display: grid;
  grid-area: 1 / 1;
  gap: 3px;
  font-size: 19px;
  font-weight: 900;
  text-align: center;
}

.donut small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.donut-row ul {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

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

.donut-row li i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.donut-row li strong {
  color: var(--ink);
}

.mix-one { background: var(--navy-2); }
.mix-two { background: var(--coral); }
.mix-three { background: var(--mint); }
.mix-four { background: var(--gold); }

.city-performance {
  margin-bottom: 18px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-nav {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.settings-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.settings-nav button.is-active {
  color: var(--navy);
  background: var(--sky);
}

.settings-form {
  padding: 24px;
}

.form-section-head h3 {
  margin: 0;
  font-size: 17px;
}

.form-section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-section-head.separated {
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #353b4c;
  font-size: 12px;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  outline: 0;
}

.form-grid input,
.form-grid select {
  height: 42px;
  padding: 0 12px;
}

.form-grid textarea {
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.6;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: #72bddc;
  box-shadow: 0 0 0 3px rgba(37, 137, 183, 0.1);
}

.span-two {
  grid-column: 1 / -1;
}

.setting-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid #edf0f2;
}

.setting-switch > span {
  display: grid;
  gap: 5px;
}

.setting-switch small {
  color: var(--muted);
  font-size: 11px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #cbd1d7;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease;
}

.switch input:checked + i {
  background: var(--success);
}

.switch input:checked + i::after {
  transform: translateX(18px);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
  opacity: 0;
  background: rgba(7, 8, 35, 0.3);
  transition: 180ms ease;
}

.drawer-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 80;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(460px, 100vw);
  visibility: hidden;
  background: #ffffff;
  box-shadow: -20px 0 50px rgba(16, 24, 45, 0.18);
  transform: translateX(102%);
  transition: 220ms ease;
}

.detail-drawer.is-open {
  visibility: visible;
  transform: translateX(0);
}

.detail-drawer > header,
.modal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.detail-drawer header p,
.modal header p {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.detail-drawer header h2,
.modal header h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.drawer-body {
  min-height: 0;
  padding: 22px 24px;
  overflow-y: auto;
}

.detail-drawer > footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  min-height: 72px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: var(--sky);
}

.detail-hero .avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.detail-hero div {
  display: grid;
  gap: 5px;
}

.detail-hero small {
  color: var(--muted);
}

.detail-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

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

.detail-grid div,
.detail-note {
  display: grid;
  gap: 5px;
}

.detail-grid span,
.detail-note span {
  color: var(--muted);
  font-size: 11px;
}

.detail-grid strong,
.detail-note strong {
  font-size: 12px;
  line-height: 1.6;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline div {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 11px;
  padding-bottom: 18px;
}

.timeline div::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: -2px;
  left: 5px;
  width: 1px;
  background: #dce1e5;
}

.timeline div:last-child::before {
  display: none;
}

.timeline i {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.timeline p {
  display: grid;
  gap: 3px;
  margin: 0;
  font-size: 12px;
}

.timeline small {
  color: var(--muted);
  font-size: 10px;
}

.modal {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(15, 22, 45, 0.24);
}

.modal::backdrop {
  background: rgba(7, 8, 35, 0.38);
  backdrop-filter: blur(2px);
}

.modal form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 40px);
}

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

.modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 230px;
  padding: 14px 16px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
  border-radius: 7px;
  color: #ffffff;
  background: var(--navy-2);
  box-shadow: var(--shadow);
  font-weight: 700;
  transition: 180ms ease;
}

.toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  color: #8fe0c6;
}

.sidebar-backdrop {
  display: none;
}

.table-subline {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.activity-drawer-tags {
  display: grid;
  gap: 9px;
}

.activity-drawer-tags span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.activity-drawer-tags svg {
  width: 15px;
  color: var(--success);
}

.catalog-settings {
  display: grid;
  gap: 10px;
}

.catalog-setting {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) repeat(3, 96px) auto;
  align-items: end;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.catalog-setting:last-child {
  border-bottom: 0;
}

.catalog-setting > div {
  display: grid;
  align-self: center;
  gap: 4px;
}

.catalog-setting > div small {
  color: var(--muted);
  font-size: 10px;
}

.catalog-setting label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.catalog-setting input {
  width: 100%;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
}

.catalog-setting input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 137, 183, 0.1);
}

#activityModal {
  width: min(760px, calc(100vw - 32px));
}

#adminNoticeList {
  max-height: 420px;
  overflow-y: auto;
}

.notice-item.is-unread {
  background: #fbfdfe;
}

.notice-item.is-unread::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--coral);
}

.notice-empty {
  padding: 30px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

@media (max-width: 1180px) {
  .topbar,
  .content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .global-search input {
    width: 180px;
  }

  .dashboard-grid,
  .insight-grid,
  .report-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(270px, 0.8fr);
  }

  .metrics-panel article,
  .report-summary article {
    padding: 18px 16px;
  }

  .metrics-panel strong,
  .report-summary strong {
    font-size: 23px;
  }
}

@media (max-width: 760px) {
  .catalog-setting {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-setting > div,
  .catalog-setting > button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .sidebar {
    z-index: 60;
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .icon-button.sidebar-close,
  .icon-button.menu-toggle {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgba(7, 8, 35, 0.32);
    transition: 180ms ease;
  }

  .sidebar-backdrop.is-open {
    visibility: visible;
    opacity: 1;
  }

  .workspace {
    margin-left: 0;
  }

  .dashboard-grid,
  .insight-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .task-panel,
  .activity-panel,
  .service-mix {
    max-width: none;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    display: flex;
    overflow-x: auto;
  }

  .settings-nav button {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 66px;
    padding: 0 14px;
  }

  .topbar h1 {
    font-size: 15px;
  }

  .topbar p,
  .global-search,
  .account-copy,
  .account-button > svg {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .account-button {
    padding: 2px;
  }

  .content {
    padding: 20px 14px;
  }

  .view-heading,
  .view-heading.compact {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .view-heading h2 {
    font-size: 23px;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .button {
    flex: 1;
  }

  .attention-strip {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .attention-strip button {
    grid-column: 2;
    justify-self: start;
    padding: 0;
  }

  .metrics-panel,
  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-panel article:nth-child(2)::after,
  .report-summary article:nth-child(2)::after {
    display: none;
  }

  .metrics-panel article:nth-child(-n + 2),
  .report-summary article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .segments {
    overflow-x: auto;
  }

  .segments button {
    flex: 0 0 auto;
  }

  .table-search input {
    width: 100%;
  }

  .table-search {
    width: 100%;
  }

  .notification-popover {
    position: fixed;
    top: 64px;
    right: 10px;
    width: min(360px, calc(100vw - 20px));
  }

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

  .span-two {
    grid-column: auto;
  }

  .donut-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-row ul {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .auth-gate {
    padding: 14px;
    background: var(--navy);
  }

  .auth-panel {
    padding: 24px 20px;
  }

  .topbar-left {
    gap: 9px;
  }

  .menu-toggle,
  .notification-button {
    width: 36px;
    height: 36px;
  }

  .account-button .avatar {
    width: 34px;
    height: 34px;
  }

  .button {
    padding: 0 12px;
    font-size: 12px;
  }

  .metrics-panel article,
  .report-summary article {
    padding: 16px 13px;
  }

  .metrics-panel strong,
  .report-summary strong {
    font-size: 21px;
  }

  .bar-chart,
  .monthly-chart {
    gap: 7px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .legend {
    display: none;
  }

  .list-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .detail-drawer > header,
  .detail-drawer > footer,
  .drawer-body,
  .modal header,
  .modal-body,
  .modal footer,
  .settings-form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .modal form {
    max-height: calc(100vh - 20px);
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
  }
}

.research-stage-note {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #bfe7d8;
  border-radius: 8px;
  color: #165f4d;
  background: #effaf6;
}

.research-stage-note > svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.research-stage-note div {
  display: grid;
  gap: 2px;
}

.research-stage-note span {
  color: #47766a;
  font-size: 12px;
}

.region-scope-note {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
  padding: 15px 17px;
  border: 1px solid #b9dcec;
  border-radius: 8px;
  color: #164c66;
  background: #eef8fc;
}

.region-scope-note > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.region-scope-note div {
  display: grid;
  gap: 3px;
}

.region-scope-note span {
  color: #537484;
  font-size: 12px;
}

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

.region-admin-form {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.region-admin-form label {
  display: grid;
  gap: 7px;
  color: #424a5e;
  font-size: 12px;
  font-weight: 700;
}

.region-admin-form input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
}

.region-admin-form input:focus {
  border-color: #66afd0;
  box-shadow: 0 0 0 3px rgba(37, 137, 183, 0.1);
}

.region-admin-list {
  overflow: hidden;
}

.region-admin-list .panel-head {
  padding: 18px 20px;
}

.scope-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 4px;
  color: #165f4d;
  background: #eaf8f3;
  font-size: 11px;
  font-weight: 800;
}

.scope-label.global {
  color: #304b84;
  background: #edf2ff;
}

@media (max-width: 1050px) {
  .region-admin-layout {
    grid-template-columns: 1fr;
  }
}

.muted-value,
.privacy-reminder {
  color: var(--muted);
  font-size: 12px;
}

.privacy-detail p {
  display: flex;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.privacy-detail svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--success);
}

.button.danger-outline {
  color: var(--danger);
  border-color: #f3c7c2;
  background: #fff;
}

.button.danger-outline:hover {
  background: var(--coral-soft);
}

@media (max-width: 760px) {
  .research-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .privacy-reminder {
    display: none;
  }

  .detail-drawer {
    inset: 0;
    width: 100vw;
    min-width: 0;
    max-width: none;
  }

  .detail-drawer > footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .detail-drawer > footer .button {
    width: 100%;
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
  }
}
