:root {
  color-scheme: light;
  --bg: #f4f5f1;
  --panel: #ffffff;
  --panel-strong: #f9faf7;
  --ink: #1e2528;
  --muted: #687074;
  --line: #d9ded7;
  --green: #2f6f5f;
  --teal: #3b8189;
  --red: #b84444;
  --amber: #af742c;
  --blue: #3c659f;
  --shadow: 0 18px 45px rgba(42, 54, 52, 0.12);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background:
    linear-gradient(135deg, rgba(47, 111, 95, 0.1), transparent 34%),
    radial-gradient(circle at 98% 8%, rgba(175, 116, 44, 0.1), transparent 26%),
    var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

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

.brand strong,
.brand span {
  display: block;
}

.brand span,
.eyebrow,
.stat span,
.sidebar-panel span,
.meta {
  color: var(--muted);
  font-size: 12px;
}

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

.nav-item,
.ghost-button,
.icon-button,
.segmented button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: #e8eee8;
  border-color: #d8e2da;
}

.sidebar-panel {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.sidebar-panel strong {
  display: block;
  font-size: 40px;
  line-height: 1.1;
  margin: 8px 0;
}

.shell {
  min-width: 0;
  padding: 28px;
}

.topbar,
.toolbar,
.workspace,
.dialog-header,
.dialog-actions,
.task-row,
.task-title-line,
.detail-head,
.subtask {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 48px);
}

h2 {
  margin-bottom: 0;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  font-weight: 750;
}

.ghost-button {
  border-color: var(--line);
  background: #fff;
  padding: 0 14px;
}

.icon-button {
  width: 40px;
  border-color: var(--line);
  background: #fff;
  font-size: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.stat strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 32px;
}

.toolbar {
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  min-width: min(420px, 100%);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.toolbar select {
  min-height: 42px;
  padding: 0 12px;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented button {
  min-width: 58px;
  min-height: 34px;
  border-radius: 6px;
}

.segmented button.active {
  background: var(--ink);
  color: #fff;
}

.workspace {
  align-items: stretch;
  gap: 14px;
}

.task-surface {
  min-width: 0;
  flex: 1;
}

.list-view,
.detail-panel,
.board-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.list-view {
  overflow: hidden;
}

.task-row {
  width: 100%;
  gap: 14px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

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

.task-row:hover,
.task-row.active {
  background: #f1f5f0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.task-main {
  min-width: 0;
  flex: 1;
}

.task-title-line {
  gap: 8px;
  margin-bottom: 6px;
}

.task-title {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf1ee;
  color: #3d4748;
  font-size: 12px;
  white-space: nowrap;
}

.pill.urgent {
  color: #fff;
  background: var(--red);
}

.pill.high {
  color: #fff;
  background: var(--amber);
}

.pill.medium {
  color: #fff;
  background: var(--blue);
}

.pill.low {
  background: #dfe8e4;
}

.pill.green {
  color: #fff;
  background: var(--green);
}

.pill.yellow {
  color: #fff;
  background: var(--amber);
}

.pill.red {
  color: #fff;
  background: var(--red);
}

.pill.excellent {
  color: #fff;
  background: var(--green);
}

.pill.good {
  color: #fff;
  background: var(--blue);
}

.pill.watch {
  color: #fff;
  background: var(--amber);
}

.task-due {
  width: 92px;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.task-due.overdue {
  color: var(--red);
  font-weight: 800;
}

.detail-panel {
  width: 360px;
  padding: 18px;
  align-self: flex-start;
  position: sticky;
  top: 20px;
}

.empty-detail {
  min-height: 240px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.empty-detail strong {
  color: var(--ink);
}

.detail-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-title {
  margin: 0 0 10px;
  font-size: 24px;
}

.detail-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.kv {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  margin: 9px 0;
}

.kv span:first-child {
  color: var(--muted);
}

.subtask {
  gap: 8px;
  padding: 7px 0;
}

.subtask input {
  width: 16px;
  height: 16px;
}

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

.board-column {
  min-height: 440px;
  padding: 12px;
  box-shadow: none;
}

.board-column h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.board-card {
  width: 100%;
  display: block;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.board-card strong {
  display: block;
  margin-bottom: 8px;
}

.project-center {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.project-portfolio {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.portfolio-item {
  min-height: 96px;
  display: grid;
  grid-template-columns: 16px 1fr;
  align-content: center;
  gap: 8px 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.portfolio-item:hover,
.portfolio-item.active {
  border-color: rgba(47, 111, 95, 0.45);
  background: #f3f7f2;
}

.portfolio-item small {
  grid-column: 2;
  color: var(--muted);
}

.project-center-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.project-center-panel.wide {
  grid-column: span 2;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
  grid-column: span 2;
}

.project-card {
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.project-card:hover,
.project-card.active {
  border-color: rgba(47, 111, 95, 0.45);
  background: #f3f7f2;
}

.project-card-head,
.project-card-metrics,
.milestone,
.linked-task {
  display: flex;
  align-items: center;
}

.project-card-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.project-card strong {
  display: block;
  margin-bottom: 9px;
  font-size: 20px;
}

.project-card p {
  min-height: 48px;
  color: var(--muted);
  line-height: 1.55;
}

.project-card-metrics {
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.health-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
}

.health-dot.yellow {
  background: var(--amber);
}

.health-dot.red {
  background: var(--red);
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e7e1;
  margin: 14px 0 12px;
}

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

.progress-track.large {
  height: 10px;
  margin-top: 18px;
}

.milestone {
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.milestone:last-child {
  border-bottom: 0;
}

.milestone small,
.linked-task small {
  color: var(--muted);
}

.linked-task {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.linked-task:hover {
  color: var(--green);
}

.risk-item {
  margin-bottom: 8px;
  padding: 10px;
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  background: #fff8ee;
}

.workload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

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

.workload-row span {
  color: var(--muted);
  font-size: 13px;
}

.workload-row .progress-track {
  grid-column: 1 / -1;
  margin: 0;
}

.project-task-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.project-task-board h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.project-task-card {
  width: 100%;
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  text-align: left;
}

.project-task-card:hover {
  border-color: rgba(47, 111, 95, 0.45);
  background: #f3f7f2;
}

.project-task-card small {
  color: var(--muted);
  line-height: 1.35;
}

.performance-layout,
.performance-center {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.performance-center {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.performance-center-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.performance-center-panel.wide {
  grid-column: span 2;
}

.rpg-panel {
  background: linear-gradient(135deg, #fffaf2 0%, #ffffff 58%, #f1f7f3 100%);
}

.rpg-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.rpg-hero-card {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.rpg-hero-card:hover,
.rpg-hero-card.active {
  border-color: rgba(217, 119, 6, 0.5);
  background: #fff9ef;
}

.rpg-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
}

.rpg-hero-main {
  min-width: 0;
}

.rpg-hero-main strong {
  display: block;
  margin: 7px 0 6px;
  font-size: 18px;
}

.rpg-xp-line,
.goal-reward-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.rpg-reward-box {
  min-width: 116px;
  padding: 10px;
  border-radius: 8px;
  background: var(--brxxl);
  color: var(--brtxt);
  text-align: right;
}

.rpg-reward-box span,
.rpg-reward-box small {
  display: block;
  font-size: 12px;
}

.rpg-reward-box strong {
  display: block;
  margin: 4px 0;
  color: var(--brd);
}

.goal-reward-line strong {
  color: var(--brd);
}

.reward-status.unlocked {
  color: #fff;
  background: var(--br);
}

.reward-status.locked {
  background: #eef1ed;
  color: var(--muted);
}

.rpg-score-hero strong {
  font-size: 28px;
}

.reward-quest {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.reward-quest:last-child {
  border-bottom: 0;
}

.reward-quest > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reward-quest.unlocked strong {
  color: var(--brd);
}

.goal-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.goal-card,
.performance-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.goal-card {
  padding: 14px;
}

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

.goal-card strong {
  display: block;
  min-height: 42px;
  line-height: 1.35;
}

.goal-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.review-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.performance-card {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 14px;
  padding: 16px;
  text-align: left;
}

.performance-card:hover,
.performance-card.active {
  border-color: rgba(47, 111, 95, 0.45);
  background: #f3f7f2;
}

.performance-card strong {
  display: block;
  margin-top: 12px;
  font-size: 22px;
}

.score-ring {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 5px solid #dce8df;
  border-radius: 50%;
  background: #fff;
  color: var(--green);
  font-size: 24px;
  font-weight: 850;
}

.performance-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.score-hero {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 12px;
  margin: 14px 0 4px;
}

.score-hero strong {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 38px;
}

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

.performance-goal {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.performance-goal:last-child {
  border-bottom: 0;
}

.performance-goal span {
  font-weight: 750;
}

.review-note,
.action-item {
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 6px;
  background: #f3f6f3;
}

.muted-note {
  color: var(--muted);
}

.action-item {
  border-left: 3px solid var(--green);
  background: #eef5f1;
}

.review-record,
.action-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  text-align: left;
}

.review-record:hover,
.action-card:hover {
  border-color: rgba(47, 111, 95, 0.45);
  background: #f3f7f2;
}

.review-record small,
.action-card small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.score-mini {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 850;
}

.action-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.action-board .action-card {
  margin-bottom: 0;
}

.goal-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.goal-plan-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.goal-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.goal-plan-card p {
  margin-bottom: 6px;
  font-weight: 750;
}

.goal-plan-card small {
  color: var(--muted);
  line-height: 1.45;
}

.goal-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.goal-levels span {
  padding: 3px 7px;
  border-radius: 99px;
  background: var(--warm);
  color: var(--brtxt);
  font-size: 11px;
}

.goal-submission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.goal-submission-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.goal-submission-head,
.smart-indicator,
.smart-meta,
.smart-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.goal-submission-head,
.smart-indicator,
.smart-meta,
.smart-actions {
  justify-content: space-between;
}

.goal-submission-head > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.goal-submission-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

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

.smart-indicator {
  padding: 10px 12px;
  border: 1px solid #dbe4dc;
  border-radius: 8px;
  background: #f4f7f4;
}

.smart-indicator span,
.smart-meta {
  color: var(--muted);
  font-size: 13px;
}

.smart-meta {
  flex-wrap: wrap;
}

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

.smart-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.smart-preview {
  padding: 12px;
  border: 1px solid #d8e2da;
  border-radius: 8px;
  background: #f3f7f2;
  color: var(--green);
  line-height: 1.6;
}

.pill.smart-type.routine {
  background: #e8f1ee;
  color: var(--green);
}

.pill.smart-type.project {
  background: #edf1f8;
  color: var(--blue);
}

.pill.smart-status.pending {
  color: #fff;
  background: var(--amber);
}

.pill.smart-status.approved {
  color: #fff;
  background: var(--green);
}

.pill.smart-status.rejected {
  color: #fff;
  background: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.dashboard-panel {
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-panel.wide {
  grid-column: span 2;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.dashboard-task-list,
.timeline {
  display: grid;
  gap: 8px;
}

.dashboard-row,
.timeline-item {
  width: 100%;
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  text-align: left;
}

.dashboard-row:hover,
.timeline-item:hover {
  border-color: rgba(47, 111, 95, 0.45);
  background: #f3f7f2;
}

.dashboard-row strong,
.timeline-item strong {
  min-width: 0;
}

.dashboard-row small {
  grid-column: 2 / 3;
  color: var(--muted);
}

.dashboard-row.compact {
  grid-template-columns: 16px 1fr;
}

.dashboard-row.compact .pill {
  justify-self: start;
}

.dashboard-row.compact small,
.dashboard-row.compact .progress-track {
  grid-column: 2;
  margin: 0;
}

.timeline-item {
  grid-template-columns: 70px 1fr;
}

.timeline-item span {
  color: var(--green);
  font-weight: 850;
}

.timeline-item small {
  grid-column: 2;
  color: var(--muted);
}

.my-task-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.my-owner-strip {
  grid-column: span 2;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.owner-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.owner-chip.active,
.owner-chip:hover {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.my-status-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.my-status-row small {
  color: var(--muted);
}

.team-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.team-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.team-panel.wide {
  grid-column: span 2;
}

.team-member-grid,
.team-project-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.team-member-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.team-member-head,
.score-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.score-line {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.reports-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.report-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-panel.wide {
  grid-column: span 2;
}

.report-summary-grid,
.report-risk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.report-risk-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.report-summary-card,
.report-row,
.report-risk {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.report-summary-card {
  padding: 14px;
}

.report-summary-card span,
.report-summary-card small,
.report-row small,
.report-risk small {
  color: var(--muted);
}

.report-summary-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
}

.report-row,
.report-risk {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  margin-bottom: 8px;
  text-align: left;
}

.report-row small,
.report-risk small {
  grid-column: 1 / -1;
}

.report-risk:hover {
  border-color: rgba(47, 111, 95, 0.45);
  background: #f3f7f2;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.admin-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-panel.wide {
  grid-column: span 2;
}

.admin-table {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.8fr 0.7fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table > div {
  min-height: 42px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.admin-table > div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.admin-table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  background: #f3f6f3 !important;
}

.admin-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.admin-item strong {
  display: block;
  margin-bottom: 6px;
}

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

.admin-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

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

.admin-editor textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(18, 30, 28, 0.32);
}

dialog::backdrop {
  background: rgba(31, 38, 38, 0.36);
}

form {
  padding: 22px;
}

.dialog-header {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 14px;
}

form input,
form select,
form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  font-weight: 500;
}

textarea {
  resize: vertical;
}

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

.dialog-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.dialog-actions > div {
  display: flex;
  gap: 10px;
}

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

@media (max-width: 1080px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .sidebar-panel {
    display: none;
  }

  .workspace {
    flex-direction: column;
  }

  .detail-panel {
    width: 100%;
    position: static;
  }

  .board-view {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

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

  .project-center,
  .project-portfolio,
  .project-task-board {
    grid-template-columns: 1fr;
  }

  .project-portfolio,
  .project-grid,
  .project-center-panel.wide {
    grid-column: auto;
  }

  .goal-strip,
  .rpg-summary-grid,
  .review-list,
  .performance-center,
  .action-board,
  .goal-plan-grid,
  .goal-submission-grid,
  .team-layout,
  .team-member-grid,
  .team-project-strip,
  .reports-layout,
  .report-summary-grid,
  .report-risk-grid,
  .dashboard-grid,
  .my-task-layout,
  .admin-grid,
  .admin-editor {
    grid-template-columns: 1fr;
  }

  .dashboard-panel.wide,
  .my-owner-strip,
  .performance-center-panel.wide,
  .team-panel.wide,
  .report-panel.wide,
  .admin-panel.wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid,
  .form-grid,
  .board-view,
  .project-grid,
  .project-center,
  .project-portfolio,
  .portfolio-item,
  .project-task-board,
  .workload-row,
  .goal-strip,
  .rpg-summary-grid,
  .review-list,
  .performance-center,
  .action-board,
  .goal-plan-grid,
  .goal-submission-grid,
  .team-layout,
  .team-member-grid,
  .team-project-strip,
  .reports-layout,
  .report-summary-grid,
  .report-risk-grid,
  .performance-card,
  .performance-metrics,
  .review-record,
  .action-card,
  .score-hero,
  .dashboard-grid,
  .my-task-layout,
  .admin-grid,
  .admin-editor,
  .dashboard-row,
  .timeline-item,
  .my-status-row,
  .team-member-head,
  .score-line,
  .report-row,
  .report-risk,
  .admin-table {
    grid-template-columns: 1fr;
  }

  .dashboard-row small,
  .dashboard-row.compact small,
  .dashboard-row.compact .progress-track,
  .timeline-item small {
    grid-column: auto;
  }

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

  .task-row {
    align-items: flex-start;
  }

  .task-due {
    display: none;
  }
}

/* Finance-style management skin */
:root {
  --bg: #eee7de;
  --panel: #ffffff;
  --panel-strong: #fff7ed;
  --ink: #172033;
  --muted: #7a8699;
  --line: #ead8c2;
  --green: #2f7d68;
  --teal: #2f8d91;
  --red: #b84444;
  --amber: #d97706;
  --blue: #3c659f;
  --br: #d97706;
  --brd: #b45309;
  --brxl: #ffe4b6;
  --brxxl: #fff7ed;
  --brtxt: #7c3f00;
  --warm: #f6efe6;
  --shadow: 0 18px 48px rgba(48, 30, 10, 0.13);
}

body {
  background: linear-gradient(180deg, #eee7de 0%, #f6efe6 100%);
}

.sidebar {
  background: linear-gradient(180deg, #1f2430 0%, #171b24 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 10px 0 30px rgba(18, 24, 36, 0.08);
}

.brand-mark {
  background: var(--br);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.brand strong {
  color: #fff;
}

.brand span,
.sidebar-panel span,
.sidebar-panel small {
  color: #aab3c2;
}

.nav-item {
  color: #b8c1cf;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 9px;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.28), rgba(217, 119, 6, 0.08));
  border-color: transparent;
  color: #fff;
  box-shadow: inset 3px 0 0 var(--br);
}

.sidebar-panel {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.shell {
  background: linear-gradient(180deg, #fbfaf8 0%, #f7f1ea 100%);
}

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

.eyebrow {
  color: #9a7550;
}

.primary-button {
  border-color: var(--br);
  background: var(--br);
}

.primary-button:hover {
  background: var(--brd);
}

.ghost-button,
.icon-button,
.search-box,
select,
input,
textarea,
.segmented,
.stat,
.list-view,
.detail-panel,
.board-column,
.dashboard-panel,
.project-card,
.project-center-panel,
.performance-center-panel,
.team-panel,
.report-panel,
.admin-panel,
.goal-card,
.performance-card,
.team-member-card,
.report-summary-card,
.report-row,
.report-risk,
.admin-table,
.project-task-card,
.portfolio-item,
.goal-plan-card {
  border-color: var(--line);
}

.stat,
.list-view,
.detail-panel,
.dashboard-panel,
.project-center-panel,
.performance-center-panel,
.team-panel,
.report-panel,
.admin-panel {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.pill {
  background: var(--warm);
  color: #6b5840;
}

.progress-track {
  background: #f0dfc8;
}

.progress-track span {
  background: linear-gradient(90deg, var(--br), #f2a93b);
}

/* Finance V3 closer layout pass */
html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: #eee7de;
}

.sidebar,
.shell {
  height: min(800px, calc(100vh - 28px));
}

.sidebar {
  width: 212px;
  min-height: 0;
  flex: 0 0 212px;
  padding: 0;
  gap: 0;
  border-radius: 18px 0 0 18px;
  overflow: hidden;
}

.brand {
  min-height: 74px;
  padding: 16px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.brand strong {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand span {
  font-size: 10px;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.nav {
  flex: 1;
  display: block;
  overflow-y: auto;
  padding: 8px 9px;
}

.nav::-webkit-scrollbar {
  width: 3px;
}

.nav::-webkit-scrollbar-thumb {
  background: #3a4657;
  border-radius: 99px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 9px;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

.sidebar-panel {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
  padding: 12px;
}

.sidebar-panel strong {
  font-size: 26px;
  margin: 4px 0;
}

.shell {
  width: min(988px, calc(100vw - 240px));
  flex: 0 1 988px;
  min-width: 0;
  padding: 18px;
  overflow-y: auto;
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-left: 0;
  border-radius: 0 18px 18px 0;
  box-shadow: 0 28px 80px rgba(48, 30, 10, 0.18);
}

.shell::-webkit-scrollbar {
  width: 4px;
}

.shell::-webkit-scrollbar-thumb {
  background: #e0d0b8;
  border-radius: 99px;
}

.topbar {
  min-height: 54px;
  padding: 0 0 14px;
  margin-bottom: 16px;
}

h1 {
  font-size: 34px;
  font-weight: 750;
  line-height: 1.1;
}

.stats-grid {
  gap: 9px;
  margin-bottom: 12px;
}

.stat {
  min-height: 112px;
  padding: 16px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(52, 36, 18, 0.05);
}

.stat strong {
  font-size: 32px;
  font-weight: 650;
}

.list-view,
.detail-panel,
.dashboard-panel,
.project-center-panel,
.performance-center-panel,
.team-panel,
.report-panel,
.admin-panel,
.project-card,
.goal-card,
.performance-card,
.team-member-card,
.report-summary-card,
.report-row,
.report-risk,
.goal-plan-card,
.portfolio-item,
.project-task-card,
.admin-table {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(52, 36, 18, 0.05);
}

.dashboard-grid,
.project-center,
.performance-center,
.team-layout,
.reports-layout,
.admin-grid,
.my-task-layout {
  padding: 0;
  gap: 12px;
}

.panel-head {
  padding-bottom: 9px;
  border-bottom: 1px solid #f0e6d6;
}

.panel-head h2 {
  font-size: 15px;
  font-weight: 650;
}

.detail-panel {
  top: 18px;
  box-shadow: 0 8px 24px rgba(52, 36, 18, 0.05);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 34px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
}

.icon-button {
  width: 38px;
}

.task-row,
.dashboard-row,
.timeline-item,
.linked-task,
.report-row,
.report-risk,
.review-record,
.action-card {
  border-radius: 9px;
}

@media (min-width: 761px) {
  body {
    display: flex !important;
    grid-template-columns: none !important;
  }

  .sidebar {
    width: 212px !important;
    min-height: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: 0 !important;
  }

  .nav {
    grid-template-columns: none !important;
  }

  .sidebar-panel {
    display: block !important;
  }

  .workspace {
    flex-direction: row !important;
  }
}

@media (max-width: 760px) {
  body {
    display: block;
    padding: 0;
  }

  .sidebar,
  .shell {
    width: 100%;
    height: auto;
    border-radius: 0;
  }

  .sidebar {
    max-height: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    padding: 8px 10px 10px;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    flex: 0 0 auto;
  }

  .sidebar-panel {
    display: none !important;
  }

  .shell {
    min-height: calc(100vh - 150px);
    padding: 14px;
    border: 0;
    box-shadow: none;
  }
}

/* Final responsive targets: desktop / tablet / phone */
@media (min-width: 1101px) {
  body {
    overflow: hidden;
  }

  .sidebar,
  .shell {
    height: min(800px, calc(100vh - 28px)) !important;
  }

  .shell {
    max-width: 988px;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  body {
    display: flex !important;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 8px;
    overflow: hidden;
  }

  .sidebar,
  .shell {
    height: calc(100vh - 16px) !important;
    border-radius: 14px;
  }

  .sidebar {
    width: 188px !important;
    flex-basis: 188px !important;
    border-radius: 14px 0 0 14px;
  }

  .brand {
    min-height: 64px;
    padding: 12px 11px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 12px;
  }

  .nav-item {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 11px;
  }

  .shell {
    width: calc(100vw - 204px);
    flex: 1 1 auto;
    border-radius: 0 14px 14px 0;
    padding: 14px;
  }

  h1 {
    font-size: 28px;
  }

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

  .workspace {
    flex-direction: column !important;
  }

  .detail-panel {
    width: 100%;
    position: static;
  }

  .goal-plan-grid,
  .goal-submission-grid,
  .rpg-summary-grid,
  .goal-strip,
  .project-portfolio,
  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .board-view,
  .project-task-board {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
  }

  body {
    background: #fbfaf8;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 90;
    border-radius: 0;
    background: #171b24;
  }

  .brand {
    min-height: 56px;
    padding: 10px 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav {
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    min-width: 78px;
    min-height: 46px;
    justify-content: center;
    text-align: center;
    padding: 6px 9px;
    border-radius: 12px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .nav-item.active {
    box-shadow: none;
    background: rgba(217, 119, 6, 0.28);
  }

  .shell {
    min-height: calc(100vh - 112px);
    padding: 12px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0 12px;
    background: rgba(251, 250, 248, 0.96);
    backdrop-filter: blur(10px);
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  h1 {
    font-size: 28px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .stat {
    min-height: 96px;
    padding: 12px;
  }

  .stat strong {
    font-size: 26px;
  }

  .workspace {
    gap: 10px;
  }

  .task-row,
  .dashboard-row,
  .timeline-item,
  .linked-task,
  .report-row,
  .report-risk,
  .review-record,
  .action-card {
    align-items: start;
  }

  .task-title {
    white-space: normal;
  }

  .detail-panel {
    width: 100%;
    padding: 14px;
  }

  .form-grid,
  .fr2,
  .fr3,
  .admin-table {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 430px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .primary-button,
  .ghost-button {
    flex: 1 1 auto;
  }

  .icon-button {
    flex: 0 0 38px;
  }
}

/* No side-scroll policy: every surface stacks as cards */
html,
body {
  max-width: 100%;
  overflow-x: hidden !important;
}

*,
*::before,
*::after {
  min-width: 0;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

.shell,
.sidebar,
.task-surface,
.list-view,
.detail-panel,
.workspace,
.topbar,
.toolbar,
.stats-grid,
.dashboard-grid,
.my-task-layout,
.project-center,
.performance-center,
.team-layout,
.reports-layout,
.admin-grid,
.project-grid,
.goal-strip,
.rpg-summary-grid,
.goal-plan-grid,
.goal-submission-grid,
.review-list,
.team-member-grid,
.team-project-strip,
.report-summary-grid,
.report-risk-grid,
.project-task-board,
.admin-editor,
.admin-table {
  max-width: 100%;
  overflow-x: hidden;
}

.task-row,
.dashboard-row,
.timeline-item,
.linked-task,
.report-row,
.report-risk,
.review-record,
.action-card,
.project-card,
.portfolio-item,
.goal-card,
.rpg-hero-card,
.goal-plan-card,
.goal-submission-card,
.performance-card,
.team-member-card,
.board-card,
.project-task-card,
.admin-item,
.stat {
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  body {
    overflow-x: hidden !important;
  }

  .shell {
    overflow-x: hidden !important;
  }

  .stats-grid,
  .dashboard-grid,
  .my-task-layout,
  .project-center,
  .performance-center,
  .team-layout,
  .reports-layout,
  .admin-grid,
  .project-grid,
  .goal-strip,
  .rpg-summary-grid,
  .goal-plan-grid,
  .goal-submission-grid,
  .review-list,
  .team-member-grid,
  .team-project-strip,
  .report-summary-grid,
  .report-risk-grid,
  .project-task-board,
  .admin-editor,
  .board-view {
    grid-template-columns: 1fr !important;
  }

  .dashboard-panel.wide,
  .project-center-panel.wide,
  .performance-center-panel.wide,
  .team-panel.wide,
  .report-panel.wide,
  .admin-panel.wide,
  .my-owner-strip,
  .project-portfolio,
  .project-grid {
    grid-column: auto !important;
  }

  .workspace {
    flex-direction: column !important;
  }

  .detail-panel {
    width: 100% !important;
    position: static !important;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
  }

  .nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    scroll-snap-type: none !important;
    padding: 8px 10px 12px;
  }

  .nav-item {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px;
    flex: none !important;
    white-space: normal !important;
    line-height: 1.25;
  }

  .topbar {
    position: static;
  }

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

  .topbar-actions .icon-button {
    width: auto;
    min-width: 0;
  }

  .search-box {
    min-width: 0;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .task-row,
  .dashboard-row,
  .timeline-item,
  .linked-task,
  .report-row,
  .report-risk,
  .review-record,
  .action-card,
  .goal-submission-head,
  .smart-indicator,
  .smart-actions,
  .performance-card,
  .rpg-hero-card,
  .reward-quest > div:first-child,
  .score-hero,
  .my-status-row,
  .team-member-head,
  .score-line,
  .workload-row,
  .admin-table {
    grid-template-columns: 1fr !important;
  }

  .dashboard-row small,
  .dashboard-row.compact small,
  .dashboard-row.compact .progress-track,
  .timeline-item small,
  .review-record small,
  .action-card small,
  .report-row small,
  .report-risk small,
  .portfolio-item small,
  .workload-row .progress-track {
    grid-column: auto !important;
  }
}

@media (max-width: 430px) {
  .nav {
    grid-template-columns: 1fr !important;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }
}
