:root {
  --paper: #f3f6f2;
  --surface: #ffffff;
  --ink: #202423;
  --muted: #68716c;
  --line: #d9e0da;
  --accent: #1d6f5f;
  --accent-dark: #124f44;
  --gold: #c48d2e;
  --danger: #b53b3b;
  --ok: #2f7b47;
  --shadow: 0 18px 45px rgba(27, 45, 39, 0.11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(90deg, rgba(29, 111, 95, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(196, 141, 46, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
}

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

button,
input {
  font: inherit;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand actions account";
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-empty {
  display: none;
}

.brand,
.account,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand,
.account {
  flex: 0 0 auto;
  width: max-content;
  white-space: nowrap;
}

.brand {
  grid-area: brand;
  justify-self: start;
  font-weight: 800;
  letter-spacing: 0;
}

.account {
  grid-area: account;
  justify-self: end;
}

.topbar-actions {
  grid-area: actions;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-actions::-webkit-scrollbar {
  display: none;
}

.topbar-actions form {
  display: flex;
  margin: 0;
  flex: 0 0 auto;
}

.topbar-actions .primary-action,
.topbar-actions .secondary-action {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  box-shadow: none;
}

.topbar-actions .primary-action svg,
.topbar-actions .secondary-action svg {
  width: 16px;
  height: 16px;
}

.topbar-dashboard {
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: ". actions account";
}

.topbar-dashboard .topbar-actions {
  width: auto;
  justify-self: center;
  justify-content: center;
}

.topbar-dashboard .account {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
}

.actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-size: 13px;
}

.account-name {
  color: var(--muted);
}

.icon-button,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.icon-button {
  width: 40px;
  color: var(--ink);
  background: transparent;
}

.primary-action,
.secondary-action {
  padding: 0 16px;
}

.primary-action {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(29, 111, 95, 0.24);
}

.secondary-action {
  color: var(--ink);
  background: #e7ece7;
}

.primary-action:hover,
.secondary-action:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-action svg,
.secondary-action svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

.flash-stack {
  position: fixed;
  right: 24px;
  top: 78px;
  display: grid;
  gap: 8px;
  z-index: 20;
}

.flash {
  min-width: 240px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.flash.error {
  border-left-color: var(--danger);
}

.auth-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-panel {
  width: min(420px, 100%);
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-heading {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input:focus {
  outline: 2px solid rgba(29, 111, 95, 0.22);
  border-color: var(--accent);
}

.auth-switch {
  margin-top: 18px;
  color: var(--accent-dark);
  font-weight: 700;
}

.workspace {
  width: min(1180px, calc(100% - 40px));
  margin: 34px auto 56px;
}

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

.status-band {
  display: grid;
  grid-template-columns: 180px 180px 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.auth-status-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.auth-status-main,
.auth-status-copy {
  min-height: 88px;
  background: var(--surface);
}

.auth-status-main {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.auth-status-main span,
.auth-status-copy span {
  color: var(--muted);
  font-size: 13px;
}

.auth-status-main strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  line-height: 1.1;
}

.auth-status-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(29, 111, 95, 0.12);
}

.auth-status-icon.authorized {
  color: var(--ok);
  background: rgba(47, 123, 71, 0.14);
}

.auth-status-icon.login_required,
.auth-status-icon.check_failed {
  color: var(--danger);
  background: rgba(181, 59, 59, 0.12);
}

.auth-status-icon.pending,
.auth-status-icon.checking {
  color: #7a5b16;
  background: rgba(196, 141, 46, 0.16);
}

.auth-status-icon svg {
  width: 22px;
  height: 22px;
}

.auth-status-copy {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
}

.auth-status-copy p {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.core-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 152px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card-head,
.metric-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.metric-card-head span,
.metric-card-foot span {
  color: var(--muted);
}

.metric-card-head svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.metric-card strong {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric-card em {
  font-style: normal;
  font-weight: 800;
}

.metric-card em.up {
  color: var(--ok);
}

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

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

.metric {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
}

.metric span,
.section-title span,
.muted,
.empty-row {
  color: var(--muted);
}

.metric strong {
  overflow-wrap: anywhere;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.section-title a {
  color: var(--accent-dark);
  font-weight: 800;
}

.section-title-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  text-align: right;
}

.snapshot {
  width: 100%;
  display: block;
  max-height: 520px;
  object-fit: cover;
  object-position: top;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
}

.empty-state svg {
  width: 34px;
  height: 34px;
}

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

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

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

th {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(29, 111, 95, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.success {
  color: var(--ok);
  background: rgba(47, 123, 71, 0.12);
}

.status-pill.failed,
.status-pill.login_required {
  color: var(--danger);
  background: rgba(181, 59, 59, 0.12);
}

.status-pill.empty {
  color: var(--muted);
  background: rgba(114, 107, 98, 0.12);
}

.report-list {
  display: grid;
}

.report-row,
.empty-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.report-row:hover {
  background: rgba(29, 111, 95, 0.08);
}

.report-row svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.paths {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.screen-shell {
  width: min(1360px, calc(100% - 40px));
  margin: 30px auto 56px;
}

.screen-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 18px;
}

.screen-status {
  display: grid;
  grid-template-columns: 145px 145px 190px 170px minmax(0, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.screen-status-item {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 15px 18px;
  background: var(--surface);
}

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

.screen-status-item strong {
  overflow-wrap: anywhere;
}

.screen-status-item strong.authorized {
  color: var(--ok);
}

.screen-status-item strong.login_required,
.screen-status-item strong.check_failed {
  color: var(--danger);
}

.screen-status-item strong.pending,
.screen-status-item strong.checking {
  color: #7a5b16;
}

.screen-status-item strong.muted {
  color: var(--muted);
}

.auto-login-dialog,
.verification-dialog,
.settings-dialog {
  width: min(860px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  overflow: visible;
}

.auto-login-dialog::backdrop,
.verification-dialog::backdrop,
.settings-dialog::backdrop {
  background: rgba(24, 31, 28, 0.42);
}

.auto-login-panel,
.verification-panel,
.schedule-panel {
  margin: 0;
}

.dialog-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auto-login-form,
.schedule-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  align-items: end;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.auto-login-form label,
.schedule-form label {
  min-width: 0;
}

.auto-login-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 700;
}

.auto-login-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

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

.auto-login-footer {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}

.auto-login-footer > div {
  display: grid;
  gap: 5px;
}

.auto-login-footer span {
  color: var(--muted);
  font-size: 12px;
}

.auto-login-footer strong {
  overflow-wrap: anywhere;
}

.verification-dialog {
  width: min(560px, calc(100% - 32px));
}

.verification-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.verification-copy {
  display: grid;
  gap: 6px;
  padding: 14px 18px 18px;
}

.verification-copy strong {
  overflow-wrap: anywhere;
}

.verification-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.schedule-footer {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.schedule-message strong {
  font-weight: 700;
}

.schedule-footer form {
  align-self: center;
  justify-self: end;
}

.app-lists-dialog {
  width: min(900px, calc(100% - 32px));
}

.app-lists-panel {
  margin: 0;
}

.app-list-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.app-list-manage {
  display: grid;
  max-height: min(480px, calc(100vh - 250px));
  overflow: auto;
}

.app-list-manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.app-list-manage-row.active {
  background: rgba(29, 111, 95, 0.08);
}

.app-list-manage-row a {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.app-list-manage-row a strong {
  overflow-wrap: anywhere;
}

.app-list-manage-row a span {
  color: var(--muted);
  font-size: 12px;
}

.add-to-list-dialog {
  width: min(560px, calc(100% - 32px));
}

.add-to-list-panel {
  margin: 0;
}

.add-to-list-form {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.add-to-list-form select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #f8faf7;
  font-weight: 700;
}

.add-to-list-form select:focus {
  outline: 2px solid rgba(29, 111, 95, 0.22);
  border-color: var(--accent);
}

.history-dialog,
.reports-dialog {
  width: min(820px, calc(100% - 32px));
}

.history-panel,
.reports-panel {
  margin: 0;
}

.dialog-table-wrap,
.dialog-report-list {
  max-height: min(560px, calc(100vh - 180px));
  overflow: auto;
}

.dialog-table-wrap table {
  min-width: 520px;
}

.logs-dialog {
  width: min(1120px, calc(100% - 32px));
}

.logs-panel {
  margin: 0;
}

.help-dialog {
  width: min(820px, calc(100% - 32px));
}

.help-panel {
  margin: 0;
}

.help-content {
  display: grid;
  max-height: min(620px, calc(100vh - 180px));
  overflow: auto;
}

.help-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}

.help-item:last-child {
  border-bottom: 0;
}

.help-item > svg {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--accent);
}

.help-item h3,
.help-item p {
  margin: 0;
}

.help-item h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.help-item p {
  color: var(--muted);
  line-height: 1.65;
}

.log-list {
  max-height: min(680px, calc(100vh - 180px));
  overflow: auto;
}

.log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

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

.log-row.high {
  border-left: 4px solid var(--danger);
}

.log-row.warning {
  border-left: 4px solid var(--gold);
}

.log-row.info {
  border-left: 4px solid var(--accent);
}

.log-row-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.log-title-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.log-title-line strong {
  overflow-wrap: anywhere;
}

.log-title-line span {
  color: var(--muted);
  font-size: 12px;
}

.log-row-main p,
.log-row-main small {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  user-select: text;
}

.log-row-main p {
  font-size: 13px;
}

.log-row-main small {
  font-size: 12px;
}

.log-row-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.log-severity,
.log-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 800;
}

.log-severity.info {
  color: var(--accent-dark);
  background: rgba(29, 111, 95, 0.1);
}

.log-severity.warning {
  color: #7a5b16;
  background: rgba(196, 141, 46, 0.14);
}

.log-severity.high {
  color: var(--danger);
  background: rgba(181, 59, 59, 0.1);
}

.log-status.success {
  color: var(--ok);
  background: rgba(47, 123, 71, 0.1);
}

.log-status.failed {
  color: var(--danger);
  background: rgba(181, 59, 59, 0.1);
}

.log-status.started,
.log-status.skipped {
  color: var(--muted);
  background: #edf1ed;
}

.danger-action {
  color: var(--danger);
}

.month-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  margin-bottom: 18px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.month-toolbar-title {
  display: grid;
  gap: 4px;
  min-width: 116px;
}

.month-toolbar-title span {
  color: var(--muted);
  font-size: 12px;
}

.month-toolbar-title strong {
  font-size: 18px;
}

.month-segments {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.list-segment {
  gap: 8px;
}

.list-segment small {
  min-width: 18px;
  min-height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(104, 113, 108, 0.12);
  font-size: 11px;
  line-height: 1;
}

.list-segment.active small {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.9);
}

.month-segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  background: #f8faf7;
}

.month-segment:hover {
  color: var(--accent-dark);
  border-color: rgba(29, 111, 95, 0.35);
  background: rgba(29, 111, 95, 0.08);
}

.month-segment.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.app-search {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(180px, 280px);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.app-search > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.app-search input[type="search"] {
  width: 100%;
  height: 38px;
  padding-right: 32px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.app-search input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-clear,
.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.search-clear {
  position: absolute;
  right: 5px;
}

.search-clear:hover {
  color: var(--danger);
  background: rgba(181, 59, 59, 0.08);
}

.search-submit {
  color: #fff;
  background: var(--accent);
}

.search-submit:hover {
  background: var(--accent-dark);
}

.search-clear svg,
.search-submit svg {
  width: 17px;
  height: 17px;
}

.app-row.is-filtered {
  display: none;
}

.search-empty {
  border-bottom: 0;
}

.inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  background: #f8faf7;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.inline-action svg {
  width: 15px;
  height: 15px;
}

.inline-action:hover {
  background: rgba(29, 111, 95, 0.08);
}

.big-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.big-metrics.all-apps-summary {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr) minmax(220px, 0.45fr);
}

.big-metric {
  min-height: 260px;
  display: grid;
  align-content: space-between;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(29, 111, 95, 0.08), transparent 48%),
    var(--surface);
  box-shadow: var(--shadow);
}

.big-metric.compact-metric {
  min-height: 260px;
}

.big-metric.primary {
  background:
    linear-gradient(135deg, rgba(29, 111, 95, 0.15), transparent 52%),
    var(--surface);
}

.big-metric-top,
.big-metric-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.big-metric-top span,
.big-metric-bottom span {
  color: var(--muted);
}

.big-metric-top svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.big-metric strong {
  font-size: clamp(52px, 8vw, 112px);
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.compact-metric strong {
  font-size: clamp(46px, 6vw, 82px);
}

.big-metric em {
  font-style: normal;
  font-weight: 800;
}

.big-metric em.up {
  color: var(--ok);
}

.big-metric em.down {
  color: var(--danger);
}

.big-metric em.muted {
  color: var(--muted);
}

.app-board-panel {
  margin-bottom: 18px;
}

.app-list {
  display: grid;
}

.app-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 0.8fr) minmax(150px, 0.6fr);
  align-items: center;
  gap: 18px;
  min-height: 94px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.all-months-row {
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 0.8fr) minmax(180px, 0.6fr);
  column-gap: 42px;
  align-items: start;
}

.app-row:hover {
  background: rgba(29, 111, 95, 0.05);
}

.app-name,
.app-metric {
  display: grid;
  gap: 7px;
}

.app-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.app-list-actions form,
.app-list-actions button {
  margin: 0;
}

.app-name strong {
  font-size: 19px;
  overflow-wrap: anywhere;
}

.app-name span,
.app-metric span {
  color: var(--muted);
  font-size: 13px;
}

.app-metric strong {
  font-size: 26px;
  line-height: 1;
}

.all-month-metric {
  align-content: start;
  min-width: 0;
}

.month-value-list {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.month-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  color: var(--muted);
}

.month-value span {
  font-size: 12px;
  color: var(--muted);
}

.month-value strong {
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: right;
}

.month-value.current span {
  color: var(--accent-dark);
  font-weight: 800;
}

.month-value.current strong {
  color: var(--ink);
  font-size: 28px;
}

.rating-month-value {
  align-items: flex-start;
}

.rating-month-stack {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.rating-month-stack small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.metric-subline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.metric-subline span {
  font-size: 12px;
}

.metric-subline strong {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  text-align: right;
}

.app-metric em {
  font-style: normal;
  font-weight: 800;
}

.app-metric em.up {
  color: var(--ok);
}

.app-metric em.down {
  color: var(--danger);
}

.app-metric em.muted {
  color: var(--muted);
}

.trend-list {
  display: grid;
}

.trend-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  min-height: 92px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.trend-date {
  display: grid;
  align-content: center;
  gap: 6px;
}

.trend-date span,
.trend-bar-line span {
  color: var(--muted);
  font-size: 13px;
}

.trend-bars {
  display: grid;
  align-content: center;
  gap: 10px;
}

.trend-bar-line {
  display: grid;
  grid-template-columns: 72px minmax(120px, 1fr) 96px;
  align-items: center;
  gap: 12px;
}

.trend-bar-line strong {
  text-align: right;
  white-space: nowrap;
}

.trend-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece7;
}

.trend-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.trend-bar-line.score .trend-track i {
  background: var(--gold);
}

.empty-state.compact {
  min-height: 180px;
}

[data-state="running"] {
  outline: 2px solid rgba(196, 141, 46, 0.38);
}

[data-state="waiting_verification"] {
  outline: 2px solid rgba(196, 141, 46, 0.48);
}

[data-state="failed"] {
  outline: 2px solid rgba(181, 59, 59, 0.28);
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand account"
      "actions actions";
    align-items: start;
    gap: 8px 16px;
    padding: 10px 16px 0;
  }

  .topbar-actions {
    justify-content: flex-start;
    margin: 0 -16px;
    padding: 0 16px 10px;
  }

  .topbar-dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "account"
      "actions";
    justify-items: center;
    padding: 10px 16px;
  }

  .topbar-dashboard .account {
    position: static;
    justify-self: end;
    transform: none;
  }

  .topbar-dashboard .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .workspace {
    width: min(100% - 24px, 1180px);
    margin-top: 22px;
  }

  .page-head,
  .screen-head,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions form,
  .actions button {
    width: 100%;
  }

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

  .month-segments {
    justify-content: flex-start;
    margin-left: 0;
  }

  .app-search {
    grid-template-columns: 24px minmax(0, 1fr);
    width: 100%;
  }

  .status-band,
  .auth-status-panel,
  .core-metrics,
  .screen-status,
  .auto-login-form,
  .verification-form,
  .app-list-create-form,
  .auto-login-footer,
  .big-metrics,
  .big-metrics.all-apps-summary,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .screen-shell {
    width: min(100% - 24px, 1360px);
    margin-top: 22px;
  }

  .big-metric {
    min-height: 210px;
  }

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

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

  .all-months-row {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

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

  .log-row-meta {
    justify-content: flex-start;
    min-width: 0;
  }

  .trend-bar-line {
    grid-template-columns: 64px minmax(90px, 1fr) 84px;
  }
}
