:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f0f4f8;
  --text: #18202a;
  --muted: #697586;
  --line: #dce3ea;
  --brand: #176b87;
  --brand-dark: #0e4f64;
  --accent: #b35f00;
  --success: #247a4d;
  --danger: #b42318;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body.portal-home .portal-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 96px));
  justify-content: start;
  align-items: start;
  gap: 20px 18px;
  padding: 14px 10px 8px;
}

body.portal-home .portal-app-card {
  min-height: 104px;
  padding: 8px 6px;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: start;
  gap: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

body.portal-home .portal-app-card:hover {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: none;
}

body.portal-home .portal-app-card .app-card-main {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

body.portal-home .portal-app-card .app-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 14px;
  font-size: 22px;
  box-shadow: 0 3px 10px rgba(15, 35, 50, 0.1);
}

body.portal-home .portal-app-card h3 {
  max-width: 92px;
  min-height: 38px;
  margin: 0;
  font-size: 16px;
  line-height: 1.18;
  font-weight: 700;
  white-space: normal;
  color: #162433;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

body.portal-home .portal-app-card .app-actions,
body.portal-home .portal-app-card .app-meta {
  display: none;
}

body.portal-home .portal-app-card.is-disabled {
  opacity: 0.62;
}

@media (max-width: 760px) {
  body.portal-home .portal-apps {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 16px 10px;
    padding: 10px 2px 4px;
  }

  body.portal-home .portal-app-card {
    min-height: 94px;
    padding: 6px 4px;
    gap: 7px;
  }

  body.portal-home .portal-app-card .app-icon {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-radius: 13px;
    font-size: 20px;
  }

  body.portal-home .portal-app-card h3 {
    max-width: 78px;
    min-height: 34px;
    font-size: 14px;
  }
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: inherit;
}

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

.sidebar {
  background: #14212b;
  color: #edf4f7;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #ffffff;
  border: 3px solid #c8242f;
  color: #c8242f;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(200, 36, 47, 0.12);
}

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

.nav a,
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: #dce9ee;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.nav a.active,
.nav button.active,
.nav a:hover,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.main {
  padding: 24px;
  overflow: auto;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.title h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0;
}

.title p {
  margin: 0;
  color: var(--muted);
}

.user-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

select,
button,
input {
  font: inherit;
  max-width: 100%;
}

select,
input,
textarea {
  min-width: 0;
  width: 100%;
}

select,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  min-height: 40px;
}

textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  min-height: 40px;
}

.button:hover {
  background: var(--brand-dark);
}

.button.secondary {
  background: #e7eef3;
  color: var(--text);
}

.text-success {
  color: var(--success);
}

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

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

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

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

.section {
  margin-top: 24px;
}

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

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.profile {
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.manual-grant-form {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.manual-grant-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.manual-grant-form .wide {
  grid-column: span 2;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #d7ecef;
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
}

.profile h2,
.app-card h3,
.metric strong {
  margin: 0;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.badge {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 13px;
  color: #304050;
}

.badge.success {
  background: #e4f5ed;
  color: var(--success);
  border-color: #bde4cf;
}

.badge.warning {
  background: #fff3df;
  color: var(--accent);
  border-color: #f4d19d;
}

.app-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  min-height: 190px;
}

.app-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #e1edf5;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.app-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.portal-main {
  max-width: 1360px;
}

.portal-topbar {
  margin-bottom: 12px;
}

.portal-profile {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-avatar {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.profile-copy .profile-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.portal-section {
  margin-top: 18px;
}

.section-head.compact {
  margin-bottom: 10px;
}

.portal-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 96px));
  gap: 20px 18px;
  align-items: start;
  justify-content: start;
  padding: 14px 10px 8px;
}

.portal-app-card {
  min-height: 104px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  align-content: start;
  justify-items: center;
  gap: 8px;
  transition: transform 0.16s ease;
}

.portal-app-card:hover {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: none;
}

.portal-app-card:focus-visible {
  outline: 2px solid rgba(21, 111, 139, 0.35);
  outline-offset: 4px;
  border-radius: 10px;
}

.app-card-main {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.app-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.portal-app-card .app-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #e8f2f7;
  box-shadow: 0 3px 10px rgba(15, 35, 50, 0.1);
  font-size: 22px;
}

.portal-app-card h3 {
  max-width: 92px;
  min-height: 38px;
  margin: 0;
  font-size: 16px;
  line-height: 1.18;
  font-weight: 700;
  color: #162433;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.portal-app-card .app-actions {
  display: none;
}

.portal-app-card.is-disabled {
  opacity: 0.62;
}

.portal-app-card.tone-cockpit {
  background: linear-gradient(135deg, #f3fbfc 0%, #ffffff 55%, #eef6f2 100%);
}

.portal-app-card.tone-cockpit .app-icon {
  background: #d8f0ea;
  color: #0f7a67;
}

.portal-app-card.tone-report .app-icon {
  background: #e3eef9;
  color: #1c6794;
}

.portal-app-card.tone-performance .app-icon {
  background: #e7f4ed;
  color: #1a7a53;
}

.portal-app-card.tone-admin .app-icon {
  background: #eef0f5;
  color: #44536a;
}

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.report-card {
  min-height: 156px;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.report-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-card h2 {
  margin: 0;
  font-size: 18px;
}

.report-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-card.is-disabled {
  box-shadow: none;
  opacity: 0.78;
}

.report-card button:disabled {
  cursor: not-allowed;
}

.analysis-main {
  max-width: 1440px;
}

.analysis-filter {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.analysis-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.analysis-summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.analysis-metric {
  min-height: 118px;
  padding: 16px;
}

.analysis-metric span,
.analysis-metric strong,
.analysis-metric small {
  display: block;
}

.analysis-metric span {
  color: var(--muted);
  margin-bottom: 10px;
}

.analysis-metric strong {
  font-size: 25px;
  line-height: 1.2;
}

.analysis-metric small {
  margin-top: 10px;
  line-height: 1.7;
}

.analysis-metric.is-important {
  border-color: #bfd7e4;
}

.analysis-layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: stretch;
}

.analysis-layout.compact {
  grid-template-columns: minmax(0, 860px);
}

.analysis-chart-card,
.analysis-side {
  padding: 16px;
}

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

.analysis-card-head h2 {
  margin: 0;
  font-size: 18px;
}

.analysis-chart {
  height: 280px;
}

.analysis-chart.compact {
  height: 180px;
}

.analysis-chart svg {
  width: 100%;
  height: 100%;
}

.analysis-report-links,
.analysis-link-group {
  display: grid;
  gap: 8px;
}

.analysis-link-group {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.analysis-link-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.analysis-link-group strong {
  color: var(--muted);
  font-size: 13px;
}

.analysis-link-group a {
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
}

.analysis-link-group a:hover,
.analysis-link-group a.active {
  border-color: #c6d9e3;
  background: #eef7fa;
  color: var(--brand-dark);
}

.analysis-link-disabled {
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: #f7f8fa;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.analysis-link-disabled small {
  color: var(--accent);
}

.analysis-empty {
  grid-column: 1 / -1;
}

.analysis-table th,
.analysis-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.analysis-table td:nth-child(2) {
  min-width: 240px;
}

.embedded-main {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

.embedded-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.embedded-toolbar h1 {
  margin: 0;
  font-size: 24px;
}

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

.embed-status {
  padding: 12px 14px;
  color: var(--muted);
}

.embedded-frame {
  width: 100%;
  height: 100%;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.warning-panel {
  color: var(--danger);
  border-color: #f2b8b5;
  background: #fff7f6;
}

.bi-shell {
  grid-template-columns: 220px 1fr;
  background: #eef3f8;
}

.bi-sidebar {
  background: #182633;
}

.bi-main {
  padding: 18px 22px;
}

.bi-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.bi-topbar h1 {
  margin: 0;
  font-size: 26px;
}

.bi-user {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.bi-filter {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.bi-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.bi-summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bi-metric {
  padding: 16px;
  min-height: 92px;
}

.bi-metric span,
.bi-metric strong {
  display: block;
}

.bi-metric span {
  color: var(--muted);
  margin-bottom: 8px;
}

.bi-metric strong {
  font-size: 28px;
}

.bi-workspace {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: start;
}

.bi-report-list,
.bi-preview {
  padding: 16px;
}

.bi-panel-title {
  color: #597084;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.bi-report-items {
  display: grid;
  gap: 8px;
}

.bi-report-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid #dbe5ee;
  background: #f8fbfd;
}

.bi-report-item.active,
.bi-report-item:hover {
  border-color: #78b3c7;
  background: #eaf5f8;
  color: var(--brand-dark);
}

.bi-report-item small {
  color: var(--muted);
  white-space: nowrap;
}

.bi-preview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.bi-preview-head h2 {
  margin: 0;
  font-size: 22px;
}

.bi-chart-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bi-chart-card {
  min-height: 190px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #dce6ee;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
}

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

.bi-chart-card span {
  color: var(--muted);
}

.bi-chart-card strong {
  margin-top: 8px;
  font-size: 30px;
}

.bi-bars {
  height: 90px;
  margin-top: 18px;
  display: flex;
  align-items: end;
  gap: 10px;
}

.bi-bars i {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: #2f8da8;
}

.bi-line {
  height: 100px;
  margin-top: 24px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 20%, #d9e8ef 20% 22%, transparent 22% 42%, #d9e8ef 42% 44%, transparent 44%),
    linear-gradient(180deg, #f7fbfd, #eef6fa);
  border: 1px solid #e0ebf1;
}

.bi-table-preview {
  margin-top: 14px;
  border: 1px solid #dce6ee;
  border-radius: 8px;
  overflow: hidden;
}

.bi-table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e8eff4;
}

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

.bi-table-row.head {
  background: #edf5f8;
  font-weight: 700;
}

.bi-page {
  background: #eef4f8;
}

.bi-header {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid #dde4eb;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

.bi-logo {
  padding: 8px 12px;
  background: #df2a20;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.bi-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 100%;
}

.bi-tabs > a,
.bi-tab > button {
  height: 100%;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: #223041;
  text-decoration: none;
  display: flex;
  align-items: center;
  font: inherit;
  cursor: pointer;
}

.bi-tabs > a:hover,
.bi-tabs > a.active,
.bi-tab:hover > button,
.bi-tab.active > button {
  background: #eaf3ff;
  color: #1f6fff;
}

.bi-tab {
  position: relative;
}

.bi-tab:hover .bi-menu {
  display: grid;
}

.bi-menu {
  display: none;
  position: absolute;
  top: 54px;
  left: 0;
  min-width: 210px;
  padding: 10px 0;
  background: #ffffff;
  border: 1px solid #e3e8ee;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  z-index: 30;
}

.bi-menu a {
  padding: 11px 18px;
  text-decoration: none;
  color: #1f2937;
  white-space: nowrap;
}

.bi-menu a:hover {
  background: #f2f7ff;
  color: #1f6fff;
}

.bi-menu a.active {
  background: #eaf3ff;
  color: #1f6fff;
  font-weight: 700;
}

.bi-header-user {
  margin-left: auto;
  color: #657384;
  font-size: 14px;
}

.bi-dashboard {
  padding: 0 10px 22px;
}

.bi-dashboard-title {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #253142;
}

.bi-dashboard-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
}

.bi-dashboard-filter label {
  min-height: 92px;
  padding: 20px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border-radius: 8px;
  color: #374151;
}

.bi-dashboard-filter input,
.bi-dashboard-filter select {
  min-height: 34px;
  padding: 6px 10px;
}

.bi-dashboard-filter .button {
  align-self: center;
  min-width: 96px;
}

.bi-kpi-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bi-kpi-card {
  min-height: 122px;
  padding: 14px;
  background: #ffffff;
  border-radius: 8px;
}

.bi-kpi-card span,
.bi-kpi-card strong,
.bi-kpi-card small {
  display: block;
  text-align: center;
}

.bi-kpi-card span {
  text-align: left;
  color: #374151;
}

.bi-kpi-card strong {
  margin-top: 24px;
  color: #4185ff;
  font-size: 24px;
}

.bi-kpi-card small {
  margin-top: 4px;
  color: #8a96a3;
}

.bi-kpi-delta.is-up {
  color: var(--success);
}

.bi-kpi-delta.is-down {
  color: var(--danger);
}

.bi-chart-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bi-dashboard-card {
  padding: 14px;
  background: #ffffff;
  border-radius: 8px;
}

.bi-dashboard-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
}

.bi-svg-chart {
  height: 330px;
}

.bi-svg-chart svg {
  width: 100%;
  height: 100%;
}

.bi-table-wrap {
  overflow: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.bi-data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
  font-size: 13px;
}

.bi-data-table th {
  background: #3b82f6;
  color: #ffffff;
  height: 38px;
  font-weight: 700;
}

.bi-data-table td {
  height: 34px;
  padding: 8px 10px;
  border-bottom: 1px solid #e8edf3;
  color: #4b5563;
}

.bi-data-table tr:nth-child(even) td {
  background: #f7f7f7;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric strong {
  font-size: 30px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  table-layout: auto;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  min-width: 112px;
  max-width: 260px;
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: break-word;
}

.table th {
  background: #edf2f6;
  font-size: 13px;
  color: #3b4b5c;
  white-space: normal;
}

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

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

.log-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.log-item strong {
  display: block;
}

.empty {
  padding: 18px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(23, 107, 135, 0.12), transparent 38%),
    linear-gradient(135deg, #fefcf6 0%, #ffffff 52%, #edf7fb 100%);
}

.access-banner {
  padding: 18px 20px;
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(23, 107, 135, 0.07) 0%, rgba(255, 255, 255, 1) 65%),
    #ffffff;
}

.access-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.access-head h2 {
  margin: 8px 0 0;
  font-size: 24px;
}

.access-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.access-stores {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-copy h2 {
  margin: 8px 0 10px;
  font-size: 30px;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 720px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero-grades {
  display: grid;
  gap: 12px;
}

.grade-card {
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
}

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

.grade-card strong {
  font-size: 18px;
  margin-bottom: 6px;
}

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

.grade-a {
  border-color: #bde4cf;
  background: linear-gradient(180deg, #f4fcf7 0%, #ffffff 100%);
}

.grade-b {
  border-color: #dce3ea;
}

.grade-c {
  border-color: #f4d19d;
  background: linear-gradient(180deg, #fffbf3 0%, #ffffff 100%);
}

.filter-bar {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.filter-bar label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.filter-keyword {
  min-width: 180px;
}

.list-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.list-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 13px;
}

.list-toolbar input,
.list-toolbar select {
  min-height: 40px;
}

.list-toolbar .badge {
  margin-bottom: 3px;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.pager .button {
  min-height: 36px;
  padding: 8px 12px;
}

.pager .button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 12px 0;
  background: var(--bg);
}

.admin-module-home {
  margin-top: 18px;
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.admin-module-card {
  min-height: 128px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-module-card h2 {
  margin: 0;
  font-size: 20px;
}

.performance-metric {
  min-height: 138px;
}

.insight-panel {
  padding: 18px;
}

.scheme-info,
.reminder-list,
.adjustment-list,
.note-list {
  display: grid;
  gap: 10px;
}

.scheme-row,
.reminder-item,
.note-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.scheme-row strong {
  display: block;
  margin-bottom: 4px;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-wrap .table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.master-main {
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
}

.master-topbar {
  align-items: center;
}

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

.master-select {
  min-width: 180px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
  font: inherit;
}

.master-panel {
  display: grid;
  gap: 14px;
}

.master-home {
  display: grid;
  gap: 16px;
}

.master-home-head h2 {
  margin: 0;
  font-size: 24px;
}

.master-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.master-app-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: 190px;
  cursor: pointer;
}

.master-app-card:hover {
  border-color: rgba(36, 99, 235, 0.35);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.master-app-card h2 {
  margin: 0;
  font-size: 20px;
}

.master-app-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.master-app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.master-metric {
  min-height: 96px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.master-metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.master-metric strong {
  display: block;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.master-table-card {
  max-height: calc(100vh - 260px);
  min-height: 420px;
  overflow: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.master-table {
  width: 100%;
  min-width: 1680px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.master-table th,
.master-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8edf3;
  text-align: left;
  vertical-align: middle;
  line-height: 1.45;
  font-size: 14px;
}

.master-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7fa;
  color: #243447;
  font-weight: 700;
}

.master-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.master-table tbody tr:hover td {
  background: #eef7fa;
}

.master-table .col-code,
.master-table .col-status,
.master-table .col-number {
  width: 108px;
  white-space: nowrap;
}

.master-table .col-date {
  width: 124px;
  white-space: nowrap;
}

.master-table .col-medium {
  width: 150px;
}

.master-table .col-name {
  width: 220px;
  font-weight: 600;
}

.master-table .col-store-name {
  width: 260px;
  font-weight: 600;
}

.master-table .col-address {
  width: 360px;
}

.master-table .col-coordinate {
  width: 190px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.master-table .col-path {
  width: 360px;
}

.master-table .col-id {
  width: 260px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  color: #334155;
  overflow-wrap: anywhere;
}

.master-table .col-id-wide {
  width: 420px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  color: #334155;
  overflow-wrap: anywhere;
}

.master-table .master-empty {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.performance-table th,
.performance-table td {
  white-space: nowrap;
}

.metric-public-table td {
  vertical-align: top;
}

.metric-breakdown {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--text);
}

.metric-breakdown span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  line-height: 1.35;
}

.metric-breakdown em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}

.metric-breakdown strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.metric-filter-bar {
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(220px, 1.4fr) auto;
}

.performance-workbench-filters {
  grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(240px, 1.5fr) auto;
}

.view-switch {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border-radius: 16px;
  background: #edf2f6;
}

.view-chip {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  cursor: pointer;
}

.view-chip.active {
  background: #ffffff;
  color: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.summary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f4f7fb;
  border: 1px solid var(--line);
  color: #324252;
}

.summary-chip strong,
.summary-chip em {
  font-style: normal;
}

.summary-chip em {
  color: var(--brand-dark);
  font-weight: 600;
}

.metric-public-table td,
.metric-public-table th {
  text-align: center;
}

.metric-public-table td:first-child,
.metric-public-table th:first-child,
.metric-public-table td:last-child,
.metric-public-table th:last-child {
  text-align: left;
}

.final-score-table td,
.final-score-table th {
  white-space: nowrap;
  vertical-align: middle;
}

.final-score-table {
  min-width: 980px;
}

.compact-table .table th,
.compact-table .table td {
  min-width: 84px;
  white-space: nowrap;
}

.approval-panel,
.approval-steps {
  display: grid;
  gap: 12px;
}

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

.approval-step {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.approval-step.approved {
  border-color: #bde4cf;
  background: #f5fbf7;
}

.approval-step.pending {
  border-color: #f4d19d;
  background: #fffaf2;
}

.approval-stage,
.approval-meta {
  display: grid;
  gap: 4px;
}

.approval-stage span {
  color: var(--muted);
}

.notice-panel,
.notice-card,
.appeal-board,
.appeal-history,
.appeal-action-panel {
  display: grid;
  gap: 12px;
}

.notice-card,
.appeal-card,
.appeal-item,
.appeal-form-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.notice-card h3,
.appeal-form-block h3 {
  margin: 0;
}

.notice-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.notice-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.appeal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.appeal-form-block label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.appeal-form-block textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  resize: vertical;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.financial-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.financial-table th,
.financial-table td {
  min-width: 0;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 52px;
  padding: 11px 14px;
  border-right: 1px solid #e7edf3;
}

.financial-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 54px;
  vertical-align: middle;
  font-weight: 700;
  background: #edf4f8;
}

.financial-table td {
  background: #ffffff;
}

.financial-table tr:nth-child(even) td {
  background: #fbfcfe;
}

.financial-table th:nth-child(1),
.financial-table td:nth-child(1),
.financial-table th:nth-child(2),
.financial-table td:nth-child(2),
.financial-table th:nth-child(3),
.financial-table td:nth-child(3) {
  position: sticky;
  z-index: 2;
}

.financial-table th:nth-child(1),
.financial-table td:nth-child(1) {
  left: 0;
  width: 128px;
}

.financial-table th:nth-child(2),
.financial-table td:nth-child(2) {
  left: 128px;
  width: 112px;
}

.financial-table th:nth-child(3),
.financial-table td:nth-child(3) {
  left: 240px;
  width: 260px;
}

.financial-table th:nth-child(1),
.financial-table th:nth-child(2),
.financial-table th:nth-child(3) {
  z-index: 4;
}

.financial-table td:nth-child(1),
.financial-table td:nth-child(2),
.financial-table td:nth-child(3) {
  background: inherit;
  box-shadow: 1px 0 0 var(--line);
}

.financial-table .cell-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.financial-table .cell-text {
  white-space: nowrap;
}

.financial-table .cell-date {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.financial-table th:not(:nth-child(-n + 3)) {
  text-align: right;
}

.financial-table th:nth-child(3),
.financial-table td:nth-child(3) {
  text-align: left;
}

.performance-table tr.is-selected td {
  background: #f5fbfd;
}

.performance-drill-row {
  cursor: pointer;
}

.performance-drill-row:hover td {
  background: #f8fbff;
}

.performance-row-summary {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
  min-width: 150px;
}

.performance-row-summary strong {
  font-size: 13px;
}

.performance-row-summary span {
  color: var(--muted);
  font-size: 12px;
}

.performance-drill-open {
  overflow: hidden;
}

.performance-drill-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: stretch;
  justify-items: end;
  padding: 18px;
  background: rgba(15, 23, 42, 0.38);
}

.performance-drill-backdrop[hidden] {
  display: none;
}

.performance-drill-dialog {
  width: min(1280px, 100%);
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
}

.performance-drill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.performance-drill-head h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.drill-nav-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.drill-nav-actions .button {
  min-height: 42px;
  white-space: nowrap;
}

.drill-nav-actions #backDrillButton:not([hidden]) {
  background: var(--brand);
  color: #ffffff;
}

.performance-drill-body {
  min-height: 0;
  overflow: hidden;
}

.performance-drill-body .detail-panel {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.performance-drill-body .source-summary-panel {
  border-right: 0;
}

.drill-title-main,
.drill-title-path {
  display: block;
}

.drill-title-path {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.drill-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.drill-step-head h3 {
  margin: 6px 0 10px;
  font-size: 22px;
}

.compact-drill-head {
  align-items: center;
  margin-bottom: 10px;
}

.compact-drill-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.compact-drill-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 6px;
}

.compact-drill-title .badge-list {
  margin: 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

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

.drill-metric-card {
  display: grid;
  gap: 12px;
  min-height: 174px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
}

.drill-metric-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.drill-card-open {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.drill-card-top,
.drill-card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.drill-card-footer {
  align-items: center;
  padding-top: 2px;
}

.drill-card-footer .row-actions {
  min-width: 0;
  justify-content: flex-end;
}

.drill-card-top strong {
  display: block;
  font-size: 18px;
}

.drill-card-top em,
.drill-card-footer small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.drill-focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 12px;
  margin-bottom: 18px;
}

.drill-focus-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.drill-focus-card > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.drill-focus-card > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.metric-value-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: 10px;
  margin-bottom: 12px;
}

.metric-value-main,
.metric-value-side {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.metric-value-main > span,
.metric-value-side > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric-value-side > strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.drill-section-head {
  margin: 8px 0 12px;
}

.drill-rule-note {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #d7e7ee;
  border-radius: 8px;
  background: #f7fbfd;
  color: var(--muted);
  font-size: 13px;
}

.source-return-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-panel {
  padding: 18px;
}

.detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.detail-header h3 {
  margin: 8px 0 0;
  font-size: 26px;
}

.detail-total {
  min-width: 200px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f6fbfc;
  border: 1px solid #d7ecef;
}

.detail-total span,
.detail-total strong {
  display: block;
}

.detail-total span {
  color: var(--muted);
  margin-bottom: 6px;
}

.detail-total strong {
  font-size: 32px;
}

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

.metric-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.performance-workbench {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.source-workbench {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.source-summary-panel,
.source-table-panel {
  padding: 12px;
}

.metric-pill {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.metric-pill.active {
  border-color: #8dc8d9;
  background: #f2fbfd;
}

.metric-pill strong {
  font-size: 16px;
}

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

.final-score-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.final-score-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.final-score-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-dark);
}

.source-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.compact-detail-header {
  gap: 8px;
  margin-bottom: 10px;
}

.compact-detail-header h3 {
  font-size: 17px;
}

.metric-compact-wrap {
  max-height: 360px;
}

.metric-compact-table {
  min-width: 720px;
}

.metric-compact-table th,
.metric-compact-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.metric-compact-table tbody tr {
  cursor: pointer;
}

.metric-compact-table tbody tr:hover td {
  background: #f6fbfc;
}

.metric-compact-table tbody tr.is-selected td {
  background: #eef8fb;
}

.metric-compact-table td:nth-child(1) {
  width: 190px;
}

.metric-compact-table td:nth-child(2) {
  min-width: 220px;
}

.metric-compact-table td:nth-child(3) {
  width: 110px;
  white-space: nowrap;
}

.metric-compact-table td:nth-child(4) {
  width: 170px;
}

.metric-bulk-actions {
  justify-content: flex-end;
  align-items: center;
}

.status-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.performance-summary-bar {
  display: grid;
  gap: 10px;
  margin: 10px 0 12px;
}

.performance-summary-main {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 8px;
}

.performance-summary-card {
  display: flex;
  min-width: 0;
  min-height: 64px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
  color: #243244;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.performance-summary-card span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
}

.performance-summary-card strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
}

.performance-summary-card:hover,
.performance-summary-card.active {
  border-color: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.performance-summary-card.success strong {
  color: #047857;
}

.performance-summary-card.warning strong {
  color: #b45309;
}

.performance-summary-card.danger strong {
  color: #dc2626;
}

.performance-summary-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1200px) {
  .performance-summary-main {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }
}

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

.compact-source-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.compact-source-grid .detail-metric {
  padding: 8px 9px;
  border-radius: 8px;
}

.compact-source-grid .detail-metric span {
  margin-bottom: 4px;
  font-size: 12px;
}

.compact-source-grid .detail-metric strong {
  font-size: 14px;
  line-height: 1.35;
}

.source-summary-lean {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.metric-preview-table {
  max-height: 260px;
}

.source-primary-table {
  max-height: 52vh;
}

.source-table-panel .table-wrap {
  max-height: 440px;
}

.source-data-table th,
.source-data-table td {
  min-width: 120px;
  white-space: nowrap;
}

.score-wide-table th,
.score-wide-table td {
  white-space: nowrap;
}

.source-line {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.compact-detail-list {
  margin-top: 6px;
}

.source-line:last-child {
  border-bottom: 0;
}

.detail-metric {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}

.detail-metric span,
.detail-metric strong {
  display: block;
}

.detail-metric span {
  color: var(--muted);
  margin-bottom: 8px;
}

.detail-metric strong {
  font-size: 22px;
}

.detail-metric-wide {
  grid-column: span 1;
}

.detail-sections {
  margin-top: 18px;
}

.detail-section h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.detail-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}

.adjustment-item {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}

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

.admin-form {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto auto;
}

.module-release-form {
  padding: 14px;
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 0.8fr 0.8fr 2fr auto auto;
  gap: 12px;
  align-items: end;
}

.module-release-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.module-release-form .wide {
  min-width: 260px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 260px;
}

.row-actions .button {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 13px;
}

.row-actions .button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.appeal-resolution-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
}

.appeal-resolution-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.appeal-resolution-head h3 {
  margin: 0 0 8px;
}

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

.appeal-resolution-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.appeal-resolution-grid textarea,
.appeal-resolution-grid select,
.appeal-resolution-grid input[type="file"] {
  width: 100%;
}

.appeal-resolution-wide {
  grid-column: 1 / -1;
}

.appeal-resolution-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.appeal-resolution-actions {
  margin-top: 14px;
  justify-content: flex-end;
}

.config-center-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

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

.config-module-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: var(--text);
  text-align: left;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.config-module-button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(36, 99, 235, 0.12);
}

.config-module-button span {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.config-editor-panel,
.config-form {
  display: grid;
  gap: 12px;
}

.config-summary {
  display: grid;
  gap: 12px;
}

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

.config-rule-panels {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.config-rule-panels strong {
  display: block;
  margin-bottom: 8px;
}

.config-form {
  padding: 14px;
}

.config-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.config-form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.config-form-head span,
.config-field small {
  color: var(--muted);
  font-size: 12px;
}

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

.config-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.config-field span {
  color: var(--text);
  font-weight: 700;
}

.config-toggle-field {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.config-toggle-field input {
  width: 22px;
  min-height: 22px;
}

.source-raw-block {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.source-raw-block .analysis-summary {
  margin-top: 0;
}

.source-raw-block .analysis-card-head {
  margin-bottom: 0;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 33, 43, 0.9), rgba(23, 107, 135, 0.72)),
    #14212b;
}

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

.login-panel {
  width: min(460px, 100%);
  padding: 28px;
}

.login-brand {
  color: var(--text);
  margin-bottom: 24px;
}

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

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

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .shell {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px;
    min-width: 0;
    overflow-x: auto;
  }

  .nav {
    grid-auto-flow: column;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .nav a,
  .nav button {
    min-width: max-content;
  }

  .main {
    width: 100%;
    min-width: 0;
    padding: 14px;
    overflow-x: hidden;
  }

  .topbar,
  .profile {
    grid-template-columns: 1fr;
    align-items: start;
    flex-wrap: wrap;
  }

  .user-switch,
  .master-actions,
  .list-toolbar,
  .pager,
  .performance-summary-tools,
  .action-row,
  .admin-toolbar {
    min-width: 0;
    width: 100%;
  }

  .user-switch,
  .master-actions,
  .pager,
  .action-row,
  .admin-toolbar {
    flex-wrap: wrap;
  }

  .card,
  .section,
  .panel,
  .profile,
  .topbar {
    max-width: 100%;
  }

  .hero,
  .access-head,
  .detail-header,
  .admin-form,
  .module-release-form,
  .filter-bar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .filter-bar,
  .performance-workbench-filters,
  .metric-filter-bar,
  .bi-dashboard-filter {
    grid-template-columns: 1fr;
  }

  .filter-bar label,
  .list-toolbar label,
  .bi-dashboard-filter label,
  .module-release-form label {
    min-width: 0;
    width: 100%;
  }

  .performance-workbench,
  .final-score-cards,
  .source-summary-grid,
  .source-workbench,
  .config-center-layout,
  .config-summary-grid,
  .config-rule-panels,
  .config-fields,
  .performance-drill-body,
  .detail-grid,
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .performance-drill-backdrop {
    padding: 8px;
    align-items: stretch;
    justify-items: stretch;
  }

  .performance-drill-dialog {
    width: 100%;
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .performance-drill-body .source-summary-panel {
    border-right: 0;
    border-bottom: 0;
  }

  .drill-step-head,
  .drill-focus-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .report-card-grid,
  .portal-app-grid,
  .admin-module-grid,
  .master-app-grid,
  .master-metrics,
  .analysis-layout,
  .bi-workspace,
  .bi-dashboard-main,
  .bi-dashboard-grid,
  .bi-kpi-grid {
    grid-template-columns: 1fr;
  }

  .table,
  .performance-table,
  .score-wide-table,
  .bi-data-table,
  .master-table {
    min-width: 920px;
  }

  .financial-table {
    min-width: 1180px;
  }

  .table th,
  .table td {
    min-width: 96px;
    max-width: 220px;
  }

  .table-wrap,
  .master-table-card,
  .bi-table-wrap {
    width: 100%;
    max-width: calc(100vw - 28px);
  }

  body.portal-home .sidebar {
    display: none;
  }

  body.portal-home .main {
    padding: 12px;
  }

  .sidebar {
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    gap: 8px;
    font-size: 15px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border-width: 2px;
    font-size: 17px;
  }

  .nav {
    gap: 6px;
    padding-bottom: 2px;
  }

  .nav a,
  .nav button {
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 14px;
  }

  .portal-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .portal-topbar .title h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
  }

  .portal-topbar .user-switch {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .portal-topbar #currentUserLabel {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 8px;
    font-size: 12px;
  }

  .portal-topbar #logoutButton {
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 13px;
  }

  .portal-profile {
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 35, 50, 0.05);
  }

  .portal-profile .compact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 16px;
  }

  .portal-profile .profile-name {
    font-size: 15px;
    line-height: 1.25;
  }

  .portal-profile .meta {
    margin-top: 2px;
    font-size: 12px;
  }

  .portal-profile .badge-list,
  .portal-profile > .button {
    display: none;
  }

  .portal-section {
    margin-top: 12px;
  }

  .portal-section .section-head.compact {
    margin-bottom: 8px;
  }

  .portal-section .section-head h2 {
    font-size: 18px;
  }

  .portal-filter-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }

  .portal-filter-toolbar label {
    width: auto;
    min-width: 0;
    gap: 4px;
    font-size: 0;
  }

  .portal-filter-toolbar input,
  .portal-filter-toolbar select {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
  }

  .portal-filter-toolbar .portal-category-filter {
    width: 112px;
  }

  .portal-filter-toolbar .badge {
    grid-column: 1 / -1;
    justify-self: start;
    margin: 0;
    padding: 3px 8px;
    font-size: 12px;
  }

  .portal-apps {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 16px 10px;
  }

  .portal-app-card {
    min-height: 94px;
    padding: 6px 4px;
    gap: 7px;
    box-shadow: none;
  }

  .portal-app-card:hover {
    transform: none;
  }

  .portal-app-card .app-card-main {
    gap: 6px;
  }

  .portal-app-card .app-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    font-size: 20px;
  }

  .portal-app-card h3 {
    max-width: 78px;
    min-height: 34px;
    font-size: 14px;
    line-height: 1.18;
  }

  .portal-app-card .app-meta {
    margin-top: 2px;
    font-size: 12px;
  }

  .portal-app-card .app-actions {
    margin-top: 0;
  }

  .portal-app-card .app-actions .badge {
    display: none;
  }

  .portal-app-card .button {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 14px;
  }
}

@media (max-width: 760px) {
  .title h1 {
    font-size: 24px;
  }

  .button {
    min-width: 0;
  }

  .report-card,
  .portal-app-card,
  .admin-module-card {
    min-width: 0;
  }

  .performance-summary-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-summary-card {
    min-height: 76px;
  }

  .performance-drill-backdrop {
    padding: 0;
    overflow: hidden;
  }

  .performance-drill-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .performance-drill-head {
    align-items: flex-start;
    gap: 10px;
    padding: 14px 12px;
  }

  .performance-drill-head h2 {
    font-size: 17px;
    line-height: 1.35;
  }

  .drill-nav-actions {
    flex-shrink: 0;
    gap: 6px;
  }

  .drill-nav-actions .button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .performance-drill-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
  }

  .performance-drill-body .detail-panel {
    min-height: auto;
    overflow: visible;
    padding: 12px;
  }

  .compact-drill-head {
    gap: 10px;
    align-items: start;
  }

  .compact-drill-title {
    align-items: flex-start;
  }

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

  .drill-metric-card {
    min-height: auto;
    padding: 14px 12px;
  }

  .drill-card-top,
  .drill-card-footer {
    gap: 8px;
  }

  .drill-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .drill-card-footer .row-actions {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .drill-card-footer .row-actions .button {
    flex: 1 1 120px;
    min-width: 0;
  }

  .metric-breakdown {
    min-width: 0;
  }

  .metric-breakdown span {
    gap: 8px;
  }
}

/* Unified portal workbench style. Keep this block last so mounted modules inherit it. */
.main,
.portal-main,
.performance-main,
.master-main {
  max-width: none;
  background: #f3f6f9;
}

.topbar,
.portal-topbar,
.master-topbar {
  min-height: 84px;
  margin: -24px -24px 22px;
  padding: 24px 32px;
  background: #ffffff;
  border-bottom: 1px solid #dbe3ec;
  box-shadow: none;
}

.title h1 {
  margin: 0;
  color: #0f1f33;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
}

.section,
.portal-section,
.master-panel,
.master-home,
.admin-module-home {
  margin-top: 18px;
}

.section,
.portal-section,
.master-panel,
.master-table-card,
.table-wrap,
.card.performance-workbench-filters,
.filter-bar.card {
  border-radius: 8px;
}

.section:has(.table-wrap),
.section:has(> table.table),
.portal-section,
.master-panel {
  padding: 18px 20px 20px;
  background: #ffffff;
  border: 1px solid #dbe3ec;
  border-top: 4px solid #0f8a83;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.section-head,
.section-head.compact {
  align-items: center;
  margin-bottom: 12px;
}

.section-head h2,
.section-head.compact h2 {
  color: #102033;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.list-toolbar,
.filter-bar,
.admin-toolbar,
.performance-workbench-filters {
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  box-shadow: none;
}

.admin-toolbar {
  top: 0;
}

.list-toolbar label,
.filter-bar label {
  min-width: 190px;
  gap: 5px;
  color: #41516a;
  font-size: 12px;
  font-weight: 700;
}

select,
input,
textarea,
.input {
  border-color: #d6dee9;
  border-radius: 7px;
  color: #132238;
  background: #ffffff;
}

select,
input,
.input {
  min-height: 38px;
  padding: 8px 12px;
}

.button {
  min-height: 38px;
  border-radius: 7px;
  padding: 8px 13px;
  font-weight: 700;
}

.badge {
  border-radius: 999px;
}

.table-wrap,
.master-table-card,
.bi-table-wrap,
.source-table-panel .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.section > table.table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.table,
.master-table,
.financial-table,
.performance-table,
.metric-compact-table,
.source-data-table,
.score-wide-table {
  min-width: 1120px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  table-layout: auto;
}

.table th,
.table td,
.master-table th,
.master-table td,
.financial-table th,
.financial-table td,
.source-data-table th,
.source-data-table td,
.metric-compact-table th,
.metric-compact-table td {
  min-width: 112px;
  max-width: 260px;
  height: 40px;
  padding: 10px 12px;
  border-bottom: 1px solid #e7edf4;
  color: #344256;
  font-size: 14px;
  line-height: 1.35;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table th,
.master-table th,
.financial-table th,
.source-data-table th,
.metric-compact-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f8fb;
  color: #3b4a60;
  font-size: 13px;
  font-weight: 800;
  white-space: normal;
  box-shadow: inset 0 -1px 0 #cfd8e3;
}

.table tbody tr:nth-child(even) td,
.master-table tbody tr:nth-child(even) td,
.financial-table tbody tr:nth-child(even) td,
.source-data-table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.table tbody tr:hover td,
.master-table tbody tr:hover td,
.financial-table tbody tr:hover td,
.source-data-table tbody tr:hover td {
  background: #f0f8f8;
}

.table tbody tr:last-child td,
.master-table tbody tr:last-child td,
.financial-table tbody tr:last-child td {
  border-bottom: 0;
}

.table td:first-child,
.master-table td:first-child,
.financial-table td:first-child {
  color: #26364a;
}

.text-danger,
.negative,
.is-negative {
  color: #d21f2b !important;
  font-weight: 800;
}

.text-success,
.positive,
.is-positive {
  color: #0f7a50 !important;
  font-weight: 800;
}

.report-card,
.portal-app-card,
.master-app-card,
.admin-module-card,
.performance-summary-card,
.log-item {
  border-color: #dbe3ec;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.report-card,
.portal-app-card,
.master-app-card,
.admin-module-card {
  min-height: 116px;
  padding: 14px;
}

.report-card p,
.portal-app-card p,
.master-app-card p,
.app-meta {
  display: none;
}

.performance-summary-main {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.performance-summary-card {
  min-height: 58px;
  padding: 9px 12px;
}

.performance-drill-dialog {
  border-radius: 8px;
}

@media (max-width: 900px) {
  .topbar,
  .portal-topbar,
  .master-topbar {
    min-height: auto;
    margin: -14px -14px 14px;
    padding: 16px 14px;
  }

  .title h1 {
    font-size: 22px;
  }

  .section:has(.table-wrap),
  .section:has(> table.table),
  .portal-section,
  .master-panel {
    padding: 12px;
  }

  .list-toolbar,
  .filter-bar,
  .admin-toolbar,
  .performance-workbench-filters {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .list-toolbar label,
  .filter-bar label {
    min-width: 0;
    width: 100%;
  }

  .table,
  .master-table,
  .financial-table,
  .performance-table,
  .metric-compact-table,
  .source-data-table,
  .score-wide-table {
    min-width: 980px;
  }

  .table th,
  .table td,
  .master-table th,
  .master-table td,
  .financial-table th,
  .financial-table td,
  .source-data-table th,
  .source-data-table td,
  .metric-compact-table th,
  .metric-compact-table td {
    min-width: 104px;
    max-width: 220px;
    height: 38px;
    padding: 9px 10px;
    font-size: 13px;
  }

  .report-card-grid,
  .portal-app-grid,
  .master-app-grid,
  .admin-module-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .performance-summary-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.portal-home .portal-filter-toolbar {
    display: none;
  }

  body.portal-home .portal-section {
    padding: 12px;
  }

  body.portal-home .portal-section .section-head.compact {
    margin-bottom: 10px;
  }

  body.portal-home .portal-apps {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 16px 10px;
  }

  body.portal-home .portal-app-card {
    min-height: 94px;
    padding: 6px 4px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    justify-items: center;
    gap: 7px;
  }

  body.portal-home .portal-app-card .app-card-main {
    min-width: 0;
    gap: 6px;
  }

  body.portal-home .portal-app-card .app-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 13px;
    font-size: 20px;
  }

  body.portal-home .portal-app-card h3 {
    margin: 0;
    max-width: 78px;
    min-height: 34px;
    font-size: 14px;
    line-height: 1.18;
    white-space: normal;
    overflow: hidden;
  }

  body.portal-home .portal-app-card .app-actions {
    display: none;
  }

  body.portal-home .portal-app-card .app-actions .badge {
    display: none;
  }

  body.portal-home .portal-app-card .button {
    min-height: 38px;
    padding: 8px 14px;
    white-space: nowrap;
  }
}

body.portal-home .portal-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  justify-content: stretch;
  align-items: stretch;
  gap: 12px;
  padding: 0;
}

body.portal-home .portal-app-card {
  min-height: 116px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: stretch;
  align-content: stretch;
  gap: 12px;
  border: 1px solid #dbe6ef;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 35, 50, 0.06);
  cursor: default;
}

body.portal-home .portal-app-card:hover {
  transform: translateY(-2px);
  border-color: #a9c9d8;
  box-shadow: 0 18px 34px rgba(15, 35, 50, 0.1);
}

body.portal-home .portal-app-card .app-card-main {
  display: flex;
  align-items: center;
  justify-items: stretch;
  min-width: 0;
  gap: 12px;
  text-align: left;
}

body.portal-home .portal-app-card .app-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  font-size: 18px;
  box-shadow: none;
}

body.portal-home .portal-app-card h3 {
  max-width: none;
  min-height: 0;
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  white-space: nowrap;
  color: #081827;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.portal-home .portal-app-card .app-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}

body.portal-home .portal-app-card .app-meta {
  display: none;
}

body.portal-home .portal-app-card .button {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
}

body.portal-home .portal-app-card.is-disabled {
  opacity: 1;
}

@media (max-width: 760px) {
  body.portal-home .portal-apps {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0;
  }

  body.portal-home .portal-app-card {
    min-height: 72px;
    padding: 12px;
    gap: 10px;
  }

  body.portal-home .portal-app-card .app-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 8px;
    font-size: 18px;
  }

  body.portal-home .portal-app-card h3 {
    max-width: none;
    min-height: 0;
    font-size: 16px;
  }
}
