:root {
  --bg: #eef3f6;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --text: #17232f;
  --ink: #263647;
  --muted: #657383;
  --line: #d8e1e8;
  --green: #238368;
  --green-strong: #12634c;
  --teal: #177c8c;
  --blue: #2c6aa4;
  --navy: #173a5e;
  --amber: #b7791f;
  --red: #bd463f;
  --shadow: 0 16px 42px rgba(34, 55, 76, 0.1);
  --shadow-soft: 0 8px 24px rgba(34, 55, 76, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 0;
  min-height: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #e8eff5 0, #f6f9fb 310px, var(--bg) 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 124, 140, 0.28);
  outline-offset: 2px;
}

.app-shell {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: clamp(14px, 1.25vw, 30px);
}

main {
  width: 100%;
  min-width: 0;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(23, 58, 94, 0.94), rgba(18, 99, 76, 0.88)),
    #102b45;
}

.login-screen.active {
  display: flex;
}

.login-card {
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
  padding: 28px;
}

.login-logo {
  display: block;
  width: 86px;
  height: 86px;
  border-radius: 8px;
  margin-bottom: 18px;
  object-fit: contain;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.login-card h1 {
  font-size: 28px;
}

.login-copy {
  margin: 10px 0 20px;
  color: var(--muted);
  line-height: 1.65;
}

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

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.demo-accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.demo-login {
  display: grid;
  gap: 4px;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.demo-login:hover {
  border-color: var(--green);
  background: #f5fbf7;
}

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

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 43, 71, 0.98), rgba(31, 88, 145, 0.96) 58%, rgba(35, 131, 104, 0.9)),
    #173a5e;
  color: #fff;
  padding: clamp(20px, 1.7vw, 34px);
  box-shadow: 0 24px 56px rgba(21, 47, 76, 0.2);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.topbar::before {
  position: absolute;
  inset: -16px;
  z-index: -2;
  background:
    url("./assets/kailas-bg.jpg") center 42% / cover no-repeat,
    linear-gradient(135deg, #173a5e, #238368);
  content: "";
  filter: blur(8px);
  transform: scale(1.04);
}

.topbar::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 28, 49, 0.88), rgba(18, 61, 98, 0.78) 48%, rgba(15, 87, 73, 0.72)),
    rgba(7, 20, 34, 0.34);
  content: "";
}

.brand-block {
  flex: 1 1 680px;
  min-width: min(680px, 100%);
}

.brand-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.kailas-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  box-shadow: none;
}

.kailas-logo-img {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 4px;
  object-fit: contain;
}

.report-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.9);
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.report-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.report-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
}

.report-meta-row strong {
  color: #fff;
  font-weight: 800;
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #d8f3e7;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
}

h3 {
  font-size: 16px;
  line-height: 1.45;
}

.view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 24px rgba(12, 31, 58, 0.12);
  backdrop-filter: blur(10px);
}

.tab-btn {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 15px;
}

.tab-btn.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 6px 16px rgba(14, 38, 61, 0.12);
}

.tab-btn.hidden {
  display: none;
}

.account-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
  justify-content: flex-end;
}

.topbar .btn.subtle {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.account-box strong,
.account-box small {
  display: block;
  text-align: right;
}

.account-box strong {
  color: #fff;
}

.account-box small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(36, 118, 87, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 251, 0.96)),
    #fff;
  box-shadow: var(--shadow);
  position: relative;
}

.hero-band::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--green), var(--blue));
  content: "";
}

.hero-copy {
  display: grid;
  align-content: center;
}

.object-text {
  max-width: none;
  margin: 0;
  color: #263b4c;
  font-size: 16px;
  line-height: 1.75;
}

.hero-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-left: 1px solid var(--line);
}

.hero-score strong,
.hero-score span {
  display: block;
}

.hero-score strong {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 18px;
}

.hero-score span {
  color: var(--muted);
}

.progress-ring {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--ring), #e4ece7 0);
  position: relative;
}

.progress-ring::after {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.progress-ring span {
  position: relative;
  z-index: 1;
  color: var(--green-strong);
  font-size: 24px;
  font-weight: 900;
}

.view-section {
  display: none;
  width: 100%;
  min-width: 0;
}

.view-section.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel,
.goal-panel,
.editor-panel,
.maintenance-toolbar,
.person-hero {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--teal), var(--blue));
  content: "";
}

.metric-card span {
  color: var(--green-strong);
  font-size: 36px;
  font-weight: 900;
}

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

.metric-card.attention span {
  color: var(--amber);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 20px;
}

.panel-head,
.editor-head,
.maintenance-toolbar,
.toolbar-actions,
.filter-row,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-head,
.editor-head,
.maintenance-toolbar,
.form-actions {
  justify-content: space-between;
}

.panel-head,
.editor-head {
  border-bottom: 1px solid #edf2f5;
  padding-bottom: 14px;
}

.wide-panel {
  min-height: 320px;
}

.person-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.person-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fff, #f7fbfc);
  padding: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.person-card:hover {
  border-color: rgba(35, 131, 104, 0.45);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.person-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #dff4ed, #dbeafe);
  color: var(--green-strong);
  font-weight: 900;
}

.person-card strong {
  color: var(--ink);
}

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

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4edf1;
}

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

.person-card-foot,
.progress-row,
.goal-row-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.focus-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.focus-item {
  border: 1px solid #e4edf1;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #fbfdfe;
  padding: 12px;
}

.focus-item.risk {
  border-left-color: var(--amber);
}

.focus-item strong,
.focus-item span {
  display: block;
}

.focus-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.compact-select {
  width: 190px;
}

.goal-table {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.report-goal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.report-goal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  background: linear-gradient(90deg, #173a5e, #2c6aa4);
  color: #fff;
}

.report-icon {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 900;
}

.report-goal-head small,
.report-goal-head strong {
  display: block;
}

.report-goal-head small {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.report-goal-head strong {
  font-size: 18px;
}

.strategy-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #d9e4ec;
  background: #f7fafc;
  padding: 13px 20px;
  color: #1c4e7b;
  font-weight: 800;
}

.strategy-strip span {
  display: inline-flex;
  min-width: 42px;
  border-radius: 6px;
  border: 1px solid #cfe0ef;
  background: #eaf3fb;
  color: #1c4e7b;
  padding: 4px 9px;
  font-size: 12px;
}

.report-table {
  display: grid;
}

.report-table-head,
.report-row {
  display: grid;
  grid-template-columns: 44px minmax(210px, 0.9fr) minmax(320px, 1.7fr) minmax(230px, 0.9fr) 140px;
  gap: 14px;
  align-items: start;
}

.report-table-head {
  background: #eef4f8;
  color: #526b82;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 16px;
}

.report-row {
  min-height: 108px;
  border-top: 1px solid #edf1f7;
  padding: 17px 16px;
}

.report-row:nth-child(odd) {
  background: #fbfdfe;
}

.measure-title {
  color: #153f66;
  font-weight: 900;
  line-height: 1.55;
}

.plan-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.plan-list li::before {
  color: var(--green);
  content: "› ";
  font-weight: 900;
}

.status-stack {
  display: grid;
  gap: 8px;
}

.status-line {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  border: 1px solid #d8eee7;
  border-radius: 7px;
  background: #f3fbf8;
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  padding: 6px 8px;
  cursor: pointer;
}

.status-line.pending {
  border-color: #e2e9ef;
  background: #f8fafc;
  color: var(--muted);
}

.status-line::before {
  content: "☑";
}

.status-line.pending::before {
  content: "☐";
}

.status-line::before,
.status-line.pending::before {
  content: none;
}

.status-line input[type="checkbox"] {
  width: 15px;
  min-width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--green);
}

.owner-stack {
  display: grid;
  gap: 7px;
}

.owner-badge {
  width: max-content;
  border-radius: 6px;
  border: 1px solid #cfe0ef;
  background: #eaf3fb;
  color: #1d5c9d;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.goal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.goal-row h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid transparent;
  background: #edf3ef;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pill.active {
  border-color: #c9e8dd;
  background: #e0f1e9;
  color: var(--green-strong);
}

.pill.risk {
  border-color: #f4d9a7;
  background: #fff1d9;
  color: var(--amber);
}

.pill.done {
  border-color: #cbdcf5;
  background: #e8f1ff;
  color: var(--blue);
}

.showcase-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

body.member-mode #showcaseView .showcase-layout {
  grid-template-columns: 1fr;
}

body.member-mode #memberPanel,
#memberPanel[hidden] {
  display: none !important;
}

.member-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.member-btn {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.member-btn.active,
.member-btn:hover {
  border-color: var(--green);
  background: #f5fbf7;
}

.showcase-main {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 18px;
}

.person-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(239,247,250,0.96)),
    #fff;
}

.person-summary {
  max-width: none;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.person-stats {
  display: grid;
  grid-template-columns: repeat(3, 110px);
  gap: 10px;
}

.person-stats div {
  display: grid;
  place-items: center;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
}

.person-stats strong,
.person-stats span {
  display: block;
}

.person-stats strong {
  color: var(--green-strong);
  font-size: 24px;
}

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

.showcase-goals {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.showcase-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 16px;
}

.showcase-card-head {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.ogsm-block {
  display: grid;
  gap: 8px;
}

.ogsm-block section {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ogsm-block h4 {
  margin: 0 0 5px;
  color: var(--green-strong);
  font-size: 12px;
}

.ogsm-block p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.maintenance-toolbar {
  margin-bottom: 18px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, #fff, #f7fbfc);
}

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

.maintenance-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 18px;
}

.goal-panel,
.editor-panel {
  min-height: calc(100vh - 280px);
}

.goal-panel {
  overflow: hidden;
  background: #f8fbfd;
}

.filters {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.search-input,
select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

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

textarea {
  resize: vertical;
  padding: 10px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 131, 104, 0.14);
}

.filter-row {
  margin-top: 10px;
}

.goal-list {
  max-height: calc(100vh - 356px);
  overflow: auto;
  padding: 10px;
}

.goal-card {
  width: 100%;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 14px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(34, 55, 76, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.goal-card:hover,
.goal-card.active {
  border-color: var(--green);
  background: #f8fcfb;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.goal-card h3 {
  display: -webkit-box;
  min-height: 46px;
  margin: 0 0 10px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.editor-panel {
  padding: 18px;
  background: #fff;
}

.editor-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.editor-form {
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.compact-head {
  margin-bottom: 12px;
}

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

.plan-check-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #f8fbfd, #f4f8fa);
  padding: 16px;
}

.plan-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  margin-bottom: 12px;
}

.plan-checklist {
  display: grid;
  gap: 8px;
}

.plan-check-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.plan-check-item input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--green);
}

.plan-check-item.done {
  background: #f4fbf7;
  color: var(--green-strong);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.legacy-source-field {
  display: none;
}

.metric-action-editor {
  display: grid;
  gap: 12px;
}

.metric-edit-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
  box-shadow: 0 6px 18px rgba(34, 55, 76, 0.05);
}

.metric-edit-head,
.action-edit-row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.metric-edit-head {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.metric-no,
.action-no {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  border-radius: 6px;
  border: 1px solid #cfe0ef;
  background: #eaf3fb;
  color: #1d5c9d;
  font-size: 12px;
  font-weight: 900;
}

.action-edit-list {
  display: grid;
  gap: 8px;
}

.action-edit-row {
  grid-template-columns: 46px 22px minmax(0, 1fr) auto;
  border: 1px solid #e3ebf1;
  border-radius: 8px;
  background: #fbfdfe;
  padding: 8px;
}

.action-edit-row.done {
  border-color: #cce9de;
  background: #f2fbf7;
}

.action-edit-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.empty-action {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.icon-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--green);
  background: #f5fbf8;
}

.icon-btn.danger {
  border-color: #efc9c5;
  color: var(--red);
}

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

.progress-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.progress-field input {
  grid-column: 1 / -1;
  padding: 0;
  accent-color: var(--green);
}

#progressValue {
  color: var(--green-strong);
}

.save-state {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 13px;
  box-shadow: 0 4px 12px rgba(34, 55, 76, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

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

.btn.subtle {
  color: var(--muted);
}

.btn.danger {
  border-color: #efc9c5;
  color: var(--red);
}

.file-btn {
  display: inline-flex;
  align-items: center;
}

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

@media (min-width: 1500px) {
  .app-shell {
    padding: 24px 36px;
  }

  .hero-band {
    grid-template-columns: minmax(0, 1fr) 380px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(360px, 0.75fr);
  }

  .showcase-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  body.member-mode #showcaseView .showcase-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .person-stats {
    grid-template-columns: repeat(3, 140px);
  }

  .maintenance-grid {
    grid-template-columns: minmax(360px, 24vw) minmax(0, 1fr);
  }

  .report-table-head,
  .report-row {
    grid-template-columns: 56px minmax(260px, 1fr) minmax(520px, 2.2fr) minmax(360px, 1.25fr) 180px;
    gap: 16px;
  }
}

@media (max-width: 1180px) {
  .hero-band,
  .dashboard-grid,
  .showcase-layout,
  .maintenance-grid {
    grid-template-columns: 1fr;
  }

  .hero-score {
    justify-content: flex-start;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }

  .goal-panel,
  .editor-panel {
    min-height: auto;
  }

  .goal-list {
    max-height: none;
  }

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

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

  .report-table-head {
    display: none;
  }

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

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .maintenance-toolbar,
  .person-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .tab-btn {
    padding: 8px 6px;
  }

  .metric-grid,
  .demo-accounts,
  .plan-add-row,
  .form-grid,
  .detail-grid,
  .person-stats {
    grid-template-columns: 1fr;
  }

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

  .toolbar-actions,
  .filter-row,
  .form-actions {
    width: 100%;
  }

  .toolbar-actions .btn,
  .toolbar-actions .file-btn,
  .filter-row select,
  .form-actions .btn {
    flex: 1 1 auto;
  }
}
