:root {
  --ink: #101820;
  --ink-2: #0d1820;
  --ink-3: #192933;
  --gold: #d7ae69;
  --gold-soft: #f4e8d3;
  --paper: #f4f6f7;
  --surface: #fff;
  --muted: #6c7880;
  --line: #e7eaec;
  --green: #2f7a62;
  --mint: #e8f3ef;
  --orange: #c78032;
  --danger: #c6544a;
  --shadow: 0 18px 55px rgba(16, 24, 32, 0.08);
}

body {
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
}

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

button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink-2);
}

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

svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-shell {
  min-height: 100vh;
  grid-template-columns: minmax(420px, 1.05fr) minmax(440px, 0.95fr);
  background: #f5f7f8;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 120px);
  color: #fff;
  background:
    radial-gradient(
      circle at 74% 20%,
      rgba(215, 174, 105, 0.22),
      transparent 20%
    ),
    linear-gradient(145deg, rgba(13, 24, 32, 0.9), rgba(13, 24, 32, 0.98)),
    #0d1820;
}

.auth-brand::before,
.auth-brand::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.07);
  transform: rotate(-18deg);
}

.auth-brand::before {
  width: 54vw;
  height: 54vw;
  top: -25vw;
  left: -20vw;
}

.auth-brand::after {
  width: 42vw;
  height: 42vw;
  right: -23vw;
  bottom: -18vw;
}

.logo,
.wordmark > span {
  color: var(--ink);
  background: var(--gold);
}

.auth-wordmark {
  position: absolute;
  top: 64px;
  left: clamp(56px, 8vw, 120px);
  font-size: 21px;
  font-weight: 850;
}

.auth-wordmark span {
  color: var(--gold);
}

.auth-brand h1 {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 34px 0 20px;
  font-size: clamp(44px, 5vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.auth-brand p {
  position: relative;
  z-index: 1;
  color: #aebac0;
}

.auth-card {
  width: min(500px, calc(100% - 54px));
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.tabs {
  gap: 6px;
  padding: 5px;
  border: 0;
  border-radius: 13px;
  background: #eef1f2;
}

.tabs button {
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.tabs button.active {
  border: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 12px rgba(16, 24, 32, 0.08);
}

label {
  color: #46525a;
  font-size: 12px;
}

input,
select,
textarea {
  min-height: 44px;
  border-color: var(--line);
  border-radius: 11px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #9ba7ad;
  box-shadow: 0 0 0 3px rgba(16, 24, 32, 0.05);
}

.auth-card form > button {
  min-height: 48px;
  margin-top: 17px;
}

#workspace {
  min-height: 100vh;
  grid-template-columns: 244px minmax(0, 1fr);
  background: var(--paper);
}

#workspace > aside {
  z-index: 30;
  height: 100vh;
  padding: 25px 18px 18px;
  background: var(--ink-2);
}

.wordmark {
  gap: 11px;
  padding: 0 8px 22px;
  font-size: 20px;
}

.wordmark > span {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.wordmark small,
.account small {
  margin-top: 1px;
  color: #75858d;
}

#nav {
  gap: 4px;
  overflow-y: auto;
}

#nav .nav-label {
  padding: 18px 11px 5px;
  color: #627179;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

#nav button {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border-radius: 12px;
  color: #98a6ad;
  background: transparent;
}

#nav button:hover,
#nav button.active {
  color: #fff;
  background: var(--ink-3);
}

#nav button.active svg {
  color: var(--gold);
}

.account {
  padding: 16px 7px 0;
  border-color: #20313b;
}

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

.account button {
  min-height: auto;
  color: #7d8c93;
}

#workspace > main {
  min-width: 0;
  padding: 0;
  background: var(--paper);
}

#workspace > main > header {
  min-height: 96px;
  align-items: center;
  margin: 0;
  padding: 20px clamp(24px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

#workspace > main > header small {
  color: #939da2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#workspace > main > header h1 {
  margin-top: 4px;
  font-size: 25px;
  letter-spacing: -0.04em;
}

#primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#content {
  padding: 28px clamp(24px, 3vw, 42px) 46px;
}

#mobile-nav,
.mobile-home-intro,
.mobile-quick-grid {
  display: none;
}

.stats {
  gap: 13px;
  margin-bottom: 16px;
}

.stat,
.panel,
.card {
  border-color: var(--line);
  border-radius: 17px;
  background: #fff;
}

.stat {
  min-height: 128px;
  padding: 20px;
}

.stat strong {
  margin-top: 12px;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.stat small,
.stat span {
  color: var(--muted);
}

.stat span {
  margin-top: 8px;
  font-size: 10px;
}

.panel {
  padding: 22px;
}

.panel h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.panel-title > div > small,
.chart-head small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.card {
  min-height: 76px;
  padding: 16px 18px;
}

.card h3 {
  font-size: 14px;
}

.card p,
.card small {
  color: var(--muted);
  font-size: 11px;
}

.badge {
  color: var(--green);
  background: var(--mint);
  font-size: 10px;
  font-weight: 700;
}

.badge.warn {
  color: var(--danger);
  background: #f9e8e6;
}

.chart-panel {
  margin-bottom: 16px;
  border-radius: 21px;
}

[data-page="home"] .chart-panel {
  color: #fff;
  border-color: #1b2b35;
  background:
    radial-gradient(circle at 84% 0, #34454f 0, transparent 33%), var(--ink-2);
}

[data-page="home"] .chart-panel .chart-head small,
[data-page="home"] .axis-text,
[data-page="home"] .missing-text {
  color: #839198;
  fill: #839198;
}

[data-page="home"] .grid-line {
  stroke: #263841;
}

[data-page="home"] .trend-line {
  stroke: var(--gold);
}

[data-page="home"] .trend-point {
  fill: var(--gold);
  stroke: #fff;
}

.todo-panel .panel-title > span {
  padding: 4px 9px;
  border-radius: 20px;
  color: var(--muted);
  background: #eef1f2;
  font-size: 10px;
}

.todo-panel button.card {
  width: 100%;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.todo-panel button.card:hover {
  border-color: #cfd6d9;
  background: #fafbfb;
}

.merchant-page-hero,
.store-hero {
  min-height: 178px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 15px;
  padding: 28px;
  overflow: hidden;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(
      circle at 84% 8%,
      rgba(215, 174, 105, 0.28),
      transparent 20%
    ),
    linear-gradient(135deg, #182a35, var(--ink-2));
}

.merchant-page-hero small,
.store-hero small {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.merchant-page-hero h2,
.store-hero h2 {
  margin: 7px 0 4px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.045em;
}

.merchant-page-hero p,
.store-hero p {
  margin: 0;
  color: #91a0a7;
}

.merchant-page-hero > span {
  min-width: 98px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
  font-size: 28px;
  font-weight: 800;
  text-align: center;
}

.merchant-page-hero > span small {
  display: block;
  margin-top: 2px;
  color: #8f9da4;
  font-size: 9px;
  letter-spacing: 0;
}

.merchant-task-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: start;
  padding: 18px;
}

.merchant-task-card.pending {
  border-color: #ead9bf;
}

.task-date {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 13px;
  color: var(--gold);
  background: var(--ink);
}

.task-date strong,
.task-date small {
  line-height: 1.05;
}

.task-date strong {
  font-size: 18px;
}

.task-date small {
  margin-top: 3px;
  color: #8c9aa1;
  font-size: 9px;
}

.task-copy > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-copy > div:first-child > small {
  color: var(--muted);
}

.task-copy h3 {
  margin-top: 9px;
}

.submitted-values {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  background: #f3f6f6;
  font-size: 10px;
}

.submitted-values b {
  color: var(--ink);
}

.activity-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.activity-card-title h3 {
  margin: 0;
}

.notification-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
}

.notification-card.unread {
  border-color: #ead9bf;
  background: #fffdf9;
}

.notification-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--gold);
  background: var(--ink);
}

.store-hero {
  justify-content: flex-start;
  align-items: center;
}

.store-hero > span {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  color: var(--ink);
  background: var(--gold);
  font-size: 23px;
  font-weight: 800;
}

.store-hero > i {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 20px;
  color: #94c7b6;
  background: rgba(47, 122, 98, 0.18);
  font-size: 10px;
  font-style: normal;
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 15px;
}

.store-profile dl {
  margin: 15px 0 0;
}

.store-profile dl > div {
  display: grid;
  grid-template-columns: 95px 1fr;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.store-profile dt {
  color: var(--muted);
  font-size: 11px;
}

.store-profile dd {
  margin: 0;
  font-size: 12px;
}

.store-help p {
  color: var(--muted);
  line-height: 1.8;
}

.store-help button {
  width: 100%;
  margin-top: 10px;
}

.history-panel {
  margin-top: 15px;
}

.history-list {
  margin-top: 14px;
}

.history-list > button {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  padding: 12px 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.history-type {
  padding: 5px 7px;
  border-radius: 8px;
  color: var(--gold);
  background: var(--ink);
  font-size: 9px;
  text-align: center;
}

.history-list strong,
.history-list p,
.history-list small {
  display: block;
  margin: 0;
}

.history-list p,
.history-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.history-list b {
  color: var(--green);
  font-size: 10px;
}

.history-list i {
  color: #9da7ac;
  font-style: normal;
}

.progress {
  background: #e8edef;
}

.progress i {
  background: var(--green);
}

.week-panel {
  margin-bottom: 16px;
}

.week-day {
  border-color: var(--line);
  border-radius: 13px;
  background: #f7f9f9;
}

.week-day.complete {
  border-color: #b9d8cd;
  background: #f0f8f5;
}

.merchant-filter {
  grid-template-columns: minmax(260px, 1.25fr) minmax(180px, 0.55fr) auto;
  padding: 17px 19px;
  border-radius: 16px;
}

.merchant-filter label {
  font-size: 11px;
}

.merchant-card-grid {
  gap: 15px;
}

.merchant-card {
  padding: 20px;
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: none;
}

.merchant-identity::before {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  content: "店";
  border-radius: 12px;
  color: var(--gold);
  background: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.merchant-identity:has(input)::before {
  display: none;
}

.merchant-identity h2 {
  font-size: 18px;
}

.risk-level {
  padding: 5px 9px;
  font-size: 10px;
}

.risk-高 {
  color: var(--danger);
  background: #f9e8e6;
}

.risk-中 {
  color: var(--orange);
  background: #fbf0df;
}

.risk-低 {
  color: var(--green);
  background: var(--mint);
}

.merchant-metrics > div,
.merchant-status-grid > div {
  border-radius: 12px;
  background: #f6f8f8;
}

.merchant-bars {
  border-color: #d8dee1;
}

.merchant-bar i {
  background: linear-gradient(180deg, #e1c38d, var(--gold));
}

.risk-summary {
  border-left-color: var(--gold);
  background: #f8f5ef;
}

.download-button {
  border-color: var(--ink);
  color: var(--ink);
}

.merchant-detail-modal .detail-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 15px;
  color: #fff;
  background: var(--ink);
}

.detail-profile > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--ink);
  background: var(--gold);
  font-size: 17px;
  font-weight: 800;
}

.detail-profile h3,
.detail-profile p {
  margin: 0;
}

.detail-profile p {
  margin-top: 3px;
  color: #8f9da4;
  font-size: 11px;
}

.detail-profile > i {
  margin-left: auto;
  font-style: normal;
}

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

.detail-kpis > div {
  padding: 12px 9px;
  border-radius: 11px;
  background: #f4f6f7;
}

.detail-kpis small,
.detail-kpis strong {
  display: block;
}

.detail-kpis small {
  color: var(--muted);
  font-size: 9px;
}

.detail-kpis strong {
  margin-top: 5px;
  font-size: 13px;
}

.merchant-detail-modal dl {
  margin: 0;
}

.merchant-detail-modal dl > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}

.merchant-detail-modal dt {
  color: var(--muted);
  font-size: 11px;
}

.merchant-detail-modal dd {
  margin: 0;
  font-size: 12px;
}

.detail-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.detail-account-head h3 {
  margin: 0;
  font-size: 15px;
}

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

.detail-account-list {
  margin-top: 9px;
}

.detail-account-list > div:not(.empty) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.detail-account-list strong,
.detail-account-list small {
  display: block;
}

.detail-account-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.detail-account-list button.danger {
  min-height: 34px;
  color: var(--danger);
  background: #f9e8e6;
}

.activity-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 85px auto;
}

.activity-date {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 14px;
  color: var(--gold);
  background: var(--ink);
}

.activity-date strong,
.activity-date small {
  line-height: 1.1;
}

.activity-date strong {
  font-size: 19px;
}

.activity-date small {
  margin-top: 3px;
  color: #8a989f;
  font-size: 9px;
}

.activity-copy {
  min-width: 0;
}

.activity-count {
  text-align: center;
}

.activity-count strong,
.activity-count small {
  display: block;
}

.activity-count strong {
  font-size: 20px;
}

.activity-count small {
  color: var(--muted);
  font-size: 9px;
}

.issue-card {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: start;
}

.issue-urgency {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--orange);
}

.issue-urgency.urgent {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(198, 84, 74, 0.1);
}

.issue-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.issue-title-row small {
  flex: 0 0 auto;
}

.issue-image-links {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.issue-image-links a {
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--ink);
  background: #eef1f2;
  font-size: 10px;
  text-decoration: none;
}

.profile-hero {
  min-height: 135px;
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 15px;
  padding: 24px;
  border-radius: 21px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 0, #34454f 0, transparent 34%), var(--ink);
}

.profile-hero > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: var(--ink);
  background: var(--gold);
  font-size: 22px;
  font-weight: 800;
}

.profile-hero h2,
.profile-hero p {
  margin: 0;
}

.profile-hero p {
  margin-top: 4px;
  color: #8e9ba2;
  font-size: 11px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 15px;
}

.profile-links > button {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #f7f9f9;
  text-align: left;
}

.profile-links .profile-logout {
  justify-content: center;
  margin-top: 18px;
  border-color: #f1d4d1;
  color: var(--danger);
  background: #f9e8e6;
}

table {
  border-radius: 13px;
  overflow: hidden;
}

th,
td {
  border-color: var(--line);
}

.model-warning {
  color: #80602c;
  background: #fbf0df;
}

dialog {
  width: min(600px, 92vw);
  max-height: 88vh;
  overflow: auto;
  border-radius: 20px;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.3);
}

dialog::backdrop {
  background: rgba(8, 15, 20, 0.72);
  backdrop-filter: blur(5px);
}

#modal-form {
  padding: 26px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 21px;
}

.dialog-head button {
  min-height: auto;
}

#success-dialog {
  padding: 32px;
}

.success-mark {
  color: var(--green);
  background: var(--mint);
}

#toast {
  z-index: 100;
  right: 24px;
  bottom: 24px;
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: var(--shadow);
}

#workspace.content-mode > main,
#workspace.content-mode #content,
#workspace.content-mode .content-frame {
  background: #fff;
}

.collaboration-hero {
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 32px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(
      circle at 88% 8%,
      rgba(212, 170, 100, 0.38),
      transparent 35%
    ),
    var(--ink);
  border-radius: 22px;
}

.collaboration-hero small {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.collaboration-hero h2 {
  margin: 7px 0 5px;
  font-size: 30px;
}

.collaboration-hero p {
  margin: 0;
  color: #cbd2d6;
}

.collaboration-hero > span {
  min-width: 110px;
  padding: 15px;
  color: var(--ink);
  background: var(--gold);
  border-radius: 18px;
  font-size: 30px;
  font-weight: 800;
  text-align: center;
}

.collaboration-hero > span small {
  display: block;
  margin-top: 2px;
  color: #58482f;
  letter-spacing: 0;
}

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

.collaboration-grid > button {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 19px;
  text-align: left;
}

.collaboration-grid i {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: var(--ink);
  border-radius: 14px;
}

.collaboration-grid svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.collaboration-grid small,
.collaboration-grid h3,
.collaboration-grid p,
.collaboration-grid strong {
  display: block;
  margin: 0;
}

.collaboration-grid small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.collaboration-grid h3 {
  margin-top: 3px;
  font-size: 18px;
}

.collaboration-grid p {
  min-height: 42px;
  margin: 7px 0 13px;
  color: var(--muted);
  font-size: 12px;
}

.collaboration-grid strong {
  font-size: 12px;
}

.collaboration-grid strong span {
  float: right;
  color: var(--gold-deep);
}

@media (max-width: 1100px) {
  #workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

  .merchant-metrics,
  .merchant-status-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  body {
    padding-bottom: calc(69px + env(safe-area-inset-bottom));
    background: var(--paper);
  }

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

  .auth-brand {
    min-height: 225px;
    display: flex;
    justify-content: flex-end;
    padding: 28px 22px;
  }

  .auth-wordmark {
    top: 26px;
    left: 22px;
  }

  .auth-brand .logo,
  .auth-brand p {
    display: none;
  }

  .auth-brand h1 {
    margin: 0;
    font-size: 35px;
  }

  .auth-card {
    width: calc(100% - 30px);
    margin: -18px auto 24px;
    padding: 22px 18px;
    border-radius: 20px;
  }

  #workspace {
    display: block;
  }

  #workspace > aside {
    display: none;
  }

  #workspace > main > header {
    min-height: auto;
    padding: 17px 16px 9px;
    border: 0;
    background: var(--paper);
    backdrop-filter: none;
  }

  #workspace > main > header small {
    display: none;
  }

  #workspace > main > header h1 {
    margin: 0;
    font-size: 19px;
  }

  #workspace > main > header #primary {
    min-height: 38px;
    padding: 0 12px;
    font-size: 11px;
  }

  #content {
    padding: 10px 16px 28px;
  }

  #mobile-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 7px 7px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
  }

  #mobile-nav button {
    min-height: 49px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    padding: 0;
    border-radius: 9px;
    color: #8c979d;
    background: transparent;
    font-size: 10px;
  }

  #mobile-nav button svg {
    width: 20px;
    height: 20px;
  }

  #mobile-nav button.active {
    color: var(--ink);
    font-weight: 750;
  }

  #mobile-nav button.active svg {
    color: var(--gold);
  }

  .mobile-home-intro {
    display: block;
    margin: 1px 0 16px;
  }

  .mobile-home-intro span {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-home-intro h2 {
    margin: 4px 0 0;
    font-size: 22px;
    letter-spacing: -0.04em;
  }

  .mobile-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }

  .mobile-quick-grid button {
    min-width: 0;
    min-height: 82px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 7px 2px;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    background: #fff;
    font-size: 10px;
  }

  .mobile-quick-grid i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--gold);
    background: var(--ink);
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .stat {
    min-height: 113px;
    padding: 15px;
    border-radius: 15px;
  }

  .stat strong {
    margin-top: 9px;
    font-size: 20px;
  }

  .panel {
    padding: 17px;
    border-radius: 17px;
  }

  .chart-panel,
  .week-panel {
    margin-bottom: 10px;
  }

  .line-chart svg {
    min-width: 620px;
  }

  .card {
    gap: 12px;
    padding: 15px;
    border-radius: 15px;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
  }

  .merchant-filter {
    grid-template-columns: minmax(0, 1.35fr) minmax(112px, 0.65fr);
    gap: 8px;
    padding: 14px;
  }

  .merchant-filter label,
  .merchant-filter input,
  .merchant-filter select {
    min-width: 0;
    width: 100%;
  }

  .merchant-filter > div {
    display: none;
  }

  .merchant-card-grid {
    gap: 10px;
  }

  .merchant-card {
    padding: 16px;
    border-radius: 17px;
  }

  .risk-workbench .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .risk-workbench .actions button {
    width: 100%;
  }

  .risk-workbench #report-risk {
    grid-column: 1 / -1;
  }

  .collaboration-hero {
    min-height: 154px;
    margin-bottom: 10px;
    padding: 20px;
    border-radius: 19px;
  }

  .collaboration-hero h2 {
    font-size: 23px;
  }

  .collaboration-hero p {
    max-width: 210px;
    font-size: 11px;
  }

  .collaboration-hero > span {
    min-width: 74px;
    padding: 11px;
    border-radius: 15px;
    font-size: 23px;
  }

  .collaboration-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .collaboration-grid > button {
    padding: 17px;
    border-radius: 17px;
  }

  .collaboration-grid p {
    min-height: 0;
  }

  .merchant-contact {
    gap: 5px 12px;
  }

  .merchant-metrics,
  .merchant-status-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .merchant-metrics > div,
  .merchant-status-grid > div {
    padding: 10px;
  }

  .merchant-bars {
    height: 125px;
  }

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

  .merchant-page-hero,
  .store-hero {
    min-height: 145px;
    padding: 20px;
    border-radius: 19px;
  }

  .merchant-page-hero h2,
  .store-hero h2 {
    font-size: 23px;
  }

  .merchant-page-hero > span {
    min-width: 72px;
    padding: 11px;
    font-size: 22px;
  }

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

  .merchant-task-card > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .notification-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .notification-card > button,
  .notification-card > .badge {
    grid-column: 2;
    justify-self: start;
  }

  .store-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .history-list > button {
    grid-template-columns: 46px minmax(0, 1fr) auto;
  }

  .history-list > button > i {
    display: none;
  }

  .activity-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .activity-card .activity-count {
    display: none;
  }

  .activity-card .actions {
    grid-column: 1 / -1;
  }

  .issue-card {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .issue-card > button {
    grid-column: 2;
    width: 100%;
  }

  .issue-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .profile-hero {
    min-height: 118px;
    margin-bottom: 10px;
    padding: 18px;
  }

  .week-grid {
    margin-inline: -17px;
    padding-inline: 17px;
  }

  dialog {
    width: calc(100% - 22px);
    max-height: calc(100vh - 36px);
  }

  #modal-form {
    padding: 20px 17px;
  }

  #toast {
    right: 13px;
    bottom: calc(79px + env(safe-area-inset-bottom));
    left: 13px;
    text-align: center;
  }

  #workspace.content-mode > main {
    height: calc(100vh - 69px - env(safe-area-inset-bottom));
  }

  #workspace.content-mode #content {
    padding: 0;
  }

  #workspace.content-mode .content-frame {
    height: calc(100vh - 69px - env(safe-area-inset-bottom));
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .tabs {
    overflow-x: auto;
  }

  .tabs button {
    min-width: 72px;
  }

  .merchant-metrics strong,
  .merchant-status-grid strong {
    font-size: 12px;
  }
}
