:root {
  --bg: #f4f6f3;
  --panel: #ffffff;
  --ink: #1b2923;
  --muted: #68756e;
  --line: #dfe7df;
  --green: #2f7d58;
  --gold: #d99b2b;
  --blue: #315f9d;
  --red: #b84646;
  --soft: #f8faf7;
  --shadow: 0 14px 34px rgba(30, 42, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  background: #173529;
  color: #fff;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 22px auto 56px;
  display: grid;
  gap: 18px;
}

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

h1 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

.subhead {
  margin-top: 8px;
  color: #cbd8cf;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-header .eyebrow {
  color: #cbd8cf;
}

.header-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 850;
}

.primary-button {
  background: var(--gold);
  color: #1b2923;
}

.secondary-button {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 0.8fr;
  gap: 14px;
}

.phase-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid #d9c18b;
  border-radius: 8px;
  background: #fff7e6;
  box-shadow: var(--shadow);
}

.phase-banner .eyebrow {
  color: #9a6417;
}

.phase-banner span {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: #173529;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

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

.metric-card {
  min-height: 126px;
  padding: 18px;
}

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

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 29px;
}

.metric-card.dark {
  background: #173529;
  color: #fff;
}

.metric-card.dark span {
  color: #cbd8cf;
}

.metric-card.warning strong {
  color: var(--red);
}

.progress {
  height: 9px;
  margin-top: 13px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
}

.progress i,
.kr-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.panel {
  padding: 20px;
}

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

.save-status {
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef4ef;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

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

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 88, 0.12);
}

.objective-board {
  display: grid;
  gap: 16px;
}

.objective-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  overflow: hidden;
}

.objective-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 16px;
  align-items: start;
  padding: 16px;
  background: #eef4ef;
}

.objective-editor {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
}

.objective-editor label {
  min-width: 0;
}

.objective-editor input,
.objective-editor textarea {
  background: #fffdf8;
}

.objective-editor textarea {
  min-height: 72px;
}

.objective-progress {
  min-width: 0;
  align-self: end;
  justify-self: end;
  text-align: right;
  font-size: 26px;
  font-weight: 900;
  color: var(--green);
}

.kr-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

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

.kr-head {
  display: grid;
  grid-template-columns: 82px minmax(240px, 1fr) 160px 120px;
  gap: 12px;
  align-items: start;
}

.kr-badge {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  border-radius: 8px;
  background: #e8f1ec;
  color: var(--green);
  font-weight: 900;
}

.kr-title strong {
  display: block;
  margin-bottom: 6px;
}

.kr-title p {
  color: var(--muted);
  line-height: 1.45;
}

.status-pill {
  border-radius: 999px;
  background: #eef2f7;
  color: var(--blue);
  padding: 8px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.status-pill.risk {
  background: #fff1e0;
  color: #a65f17;
}

.status-pill.done {
  background: #e8f5ee;
  color: var(--green);
}

.status-pill.todo {
  background: #f0f0f0;
  color: #66706a;
}

.kr-progress {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #ecf1ed;
}

.metric-table {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 110px 110px 90px;
  gap: 10px;
  align-items: center;
}

.metric-name {
  color: var(--ink);
  font-weight: 750;
}

.metric-row output {
  color: var(--green);
  font-weight: 900;
}

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

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
}

.segmented button.active {
  background: #173529;
  color: #fff;
}

.task-form,
.task-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 120px 120px 120px 140px 84px;
  gap: 10px;
}

.task-form {
  margin-bottom: 14px;
}

.task-card {
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

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

.delete-button {
  min-height: 42px;
  border: 1px solid #f0c5c5;
  border-radius: 8px;
  background: #fff4f4;
  color: var(--red);
  font-weight: 900;
}

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

.mini-panel p:last-child {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 980px) {
  .app-header,
  .section-title,
  .objective-head {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button {
    flex: 1;
  }

  .metrics-grid,
  .phase-banner,
  .morning-grid,
  .objective-editor,
  .kr-head,
  .metric-row,
  .task-form,
  .task-card,
  .roadmap-grid {
    grid-template-columns: 1fr;
  }

  .objective-progress {
    text-align: left;
  }
}
