:root {
  color-scheme: light;
  --ink: #17211e;
  --ink-soft: #52605b;
  --muted: #77837f;
  --line: #dfe5e2;
  --line-strong: #cbd5d0;
  --canvas: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --sidebar: #13231e;
  --sidebar-soft: #1b3029;
  --green: #147a5b;
  --green-dark: #0f6048;
  --green-soft: #e7f4ef;
  --blue: #3567a8;
  --blue-soft: #eaf0f8;
  --amber: #b66a10;
  --amber-soft: #fff3df;
  --red: #b8443c;
  --red-soft: #fbecea;
  --shadow: 0 1px 2px rgba(18, 35, 29, 0.05), 0 8px 24px rgba(18, 35, 29, 0.04);
  --sidebar-width: 248px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(20, 122, 91, 0.35);
  outline-offset: 2px;
}

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

h1,
h2,
h3,
strong {
  overflow-wrap: anywhere;
}

.hidden,
.role-hidden {
  display: none !important;
}

.eyebrow,
.workspace-eyebrow,
.panel-heading span,
.metric > span,
.field-control > span,
.form-section-heading span,
.nav-section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  color: #f4f8f6;
  background: var(--sidebar);
  border-right: 1px solid #0d1b17;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 2px 8px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #0d4f3b;
  background: #dff4ec;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 13px;
  font-weight: 800;
}

.brand-mark.large {
  width: 48px;
  height: 48px;
  font-size: 15px;
}

.brand > span:last-child,
.login-brand > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand strong,
.login-brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand small,
.login-brand span {
  color: #9fb0aa;
  font-size: 11px;
}

.cycle-card {
  margin: 20px 6px 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--sidebar-soft);
  border: 1px solid #2a4038;
  border-radius: 8px;
}

.cycle-card > span,
.cycle-card small {
  color: #9fb0aa;
  font-size: 11px;
}

.cycle-card strong {
  font-size: 13px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-label {
  padding: 16px 10px 5px;
  color: #74867f;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: #c5d0cc;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.nav-item > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #8fa19a;
  background: #1d342c;
  border: 1px solid #29443b;
  border-radius: 5px;
  font-size: 9px;
}

.nav-item:hover {
  color: #ffffff;
  background: #192e27;
}

.nav-item.active {
  color: #ffffff;
  background: #24483c;
  border-color: #315d4e;
}

.nav-item.active > span {
  color: #0b4d39;
  background: #d9f2e9;
  border-color: #d9f2e9;
}

.identity-card {
  margin-top: auto;
  padding: 14px 8px 8px;
  border-top: 1px solid #2a3d36;
}

.signed-user,
.member-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #0c5b43;
  background: #d9f1e8;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.member-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.member-name strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-name span {
  color: #93a49e;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
  color: #9fb0aa;
  font-size: 11px;
}

.role-pill,
.status-pill,
.hint-pill,
.source-badge,
.live-badge,
.database-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.role-pill {
  color: #bcf1df;
  background: #1d483a;
}

.text-button {
  padding: 4px 0;
  color: var(--green);
  background: transparent;
  border: 0;
  font-weight: 700;
}

.sidebar .text-button {
  color: #b7c9c2;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 8px 0;
  color: #879a93;
  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.status-dot.online {
  background: #4ecb96;
}

.main-panel {
  grid-column: 2;
  min-width: 0;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.workspace-heading {
  min-width: 0;
}

.workspace-heading h1 {
  margin-top: 1px;
  font-size: 20px;
  line-height: 1.25;
}

.workspace-subtitle {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
}

.topbar-actions,
.inline-actions,
.chart-controls,
.view-tabs,
.data-scope-tabs,
.form-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.view-tab,
.scope-tab {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 700;
  line-height: 1.2;
}

.primary-button {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.primary-button:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line-strong);
}

.secondary-button:hover,
.ghost-button:hover {
  background: var(--surface-soft);
  border-color: #aebcb6;
}

.icon-button {
  width: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line);
  font-size: 22px;
}

.compact-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.page-canvas {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 24px 28px 44px;
}

.workspace {
  min-width: 0;
}

.context-toolbar,
.data-commandbar,
.okr-page-heading,
.database-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.context-toolbar > div:first-child,
.personal-toolbar > div:first-child {
  display: flex;
  flex-direction: column;
}

.context-toolbar span,
.data-freshness {
  color: var(--muted);
  font-size: 11px;
}

.context-toolbar strong {
  font-size: 14px;
}

.metrics-grid,
.personal-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.personal-metrics article {
  min-height: 118px;
  padding: 17px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric::before,
.personal-metrics article::before {
  content: "";
  width: 28px;
  height: 3px;
  background: var(--green);
  border-radius: 3px;
}

.metric:nth-child(2)::before,
.personal-metrics article:nth-child(2)::before {
  background: var(--blue);
}

.metric:nth-child(4)::before,
.personal-metrics article:nth-child(3)::before {
  background: #6b5ba7;
}

.metric.risk::before,
.personal-metrics article.risk::before {
  background: var(--amber);
}

.metric strong,
.personal-metrics strong {
  margin-top: 7px;
  font-size: 28px;
  line-height: 1;
}

.metric small,
.personal-metrics small {
  color: var(--ink-soft);
  font-size: 11px;
}

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

.panel-heading {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-heading strong {
  font-size: 15px;
}

.dashboard-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 16px;
}

.chart-controls select,
.inline-actions input,
.inline-actions select,
.member-directory-toolbar input,
.field-control input,
.field-control select,
.field-control textarea,
.kr-row-actions input,
.kr-row-actions select,
.data-table input,
.data-table select,
.my-task-row select {
  min-height: 36px;
  padding: 7px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.chart-board {
  min-height: 320px;
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-row {
  display: grid;
  gap: 7px;
}

.chart-label,
.team-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-label span {
  min-width: 0;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-track,
.progress-track {
  height: 7px;
  overflow: hidden;
  background: #e8eeeb;
  border-radius: 99px;
}

.chart-bar,
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.chart-bar.tone-1 {
  background: var(--blue);
}

.chart-bar.tone-2 {
  background: var(--amber);
}

.chart-bar.tone-3 {
  background: #6b5ba7;
}

.risk-list,
.team-progress,
.dashboard-summary,
.activity-timeline {
  padding: 8px 16px 16px;
}

.risk-line,
.team-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.risk-line:last-child,
.team-line:last-child {
  border-bottom: 0;
}

.risk-line > div,
.team-line > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.risk-line strong,
.team-line strong {
  font-size: 12px;
}

.risk-line span,
.team-line span {
  color: var(--muted);
  font-size: 10px;
}

.status-pill.active,
.status-pill.done {
  color: var(--green-dark);
  background: var(--green-soft);
}

.status-pill.at_risk,
.status-pill.blocked {
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.draft,
.status-pill.todo,
.status-pill.archived {
  color: #5e6d68;
  background: #edf1ef;
}

.status-pill.doing {
  color: var(--blue);
  background: var(--blue-soft);
}

.live-badge,
.hint-pill,
.source-badge {
  color: var(--green-dark);
  background: var(--green-soft);
}

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

.summary-stat {
  min-height: 74px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-stat:nth-child(even) {
  border-right: 0;
}

.summary-stat:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.summary-stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-stat strong {
  margin-top: 5px;
  font-size: 22px;
}

.personal-work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.7fr);
  gap: 16px;
}

.my-work-list,
.my-okr-list {
  padding: 6px 16px 16px;
}

.my-task-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 100px 145px auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.my-task-row.needs-attention {
  background: #fffaf2;
}

.task-state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca8a4;
}

.task-state-dot.doing {
  background: var(--blue);
}

.task-state-dot.done {
  background: var(--green);
}

.task-state-dot.blocked {
  background: var(--red);
}

.my-task-main,
.my-task-due,
.my-okr-row > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.my-task-main strong,
.my-okr-row strong {
  font-size: 12px;
}

.my-task-main span,
.my-task-due span,
.my-okr-row span {
  color: var(--muted);
  font-size: 10px;
}

.my-task-due.overdue strong {
  color: var(--red);
}

.my-okr-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

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

.progress-ring strong {
  position: relative;
  z-index: 1;
  font-size: 10px;
}

.compact-ring {
  width: 42px;
  height: 42px;
}

.data-commandbar {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.view-tabs,
.data-scope-tabs {
  padding: 3px;
  background: #edf1ef;
  border-radius: 7px;
}

.view-tab,
.scope-tab {
  min-height: 32px;
  padding: 6px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: 11px;
}

.view-tab.active,
.scope-tab.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(20, 35, 30, 0.12);
}

.inline-actions input {
  width: min(360px, 36vw);
}

.okr-page-heading,
.database-heading {
  align-items: flex-end;
  padding: 10px 2px 2px;
}

.okr-page-heading h2,
.database-heading h2 {
  margin-top: 2px;
  font-size: 22px;
}

.okr-page-heading p:not(.eyebrow),
.database-heading p:not(.eyebrow) {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.okr-list {
  display: grid;
  gap: 12px;
}

.okr-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.objective-group-head {
  min-height: 92px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.objective-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.objective-title-line h3 {
  font-size: 15px;
}

.objective-group-head p {
  max-width: 900px;
  margin: 8px 0 0 33px;
  color: var(--ink-soft);
  font-size: 12px;
}

.row-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 5px;
}

.count-pill {
  color: var(--ink-soft);
  font-size: 11px;
}

.objective-meta-stack {
  display: flex;
  align-items: center;
  gap: 10px;
}

.objective-submeta {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  color: var(--muted);
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.objective-progress {
  padding: 10px 16px 0;
}

.db-table {
  width: 100%;
  overflow-x: auto;
}

.db-row {
  min-width: 920px;
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(140px, 0.8fr) minmax(150px, 0.9fr) 70px 100px 110px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.db-head {
  min-height: 38px;
  color: var(--muted);
  background: #f7f9f8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.db-title-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-title-cell strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-progress-cell {
  display: grid;
  gap: 5px;
}

.okr-card > .inline-actions {
  justify-content: flex-end;
  padding: 10px 16px;
}

.data-table-wrap {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  background: #f7f9f8;
  font-size: 10px;
  text-transform: uppercase;
}

.data-table td {
  font-size: 11px;
}

.data-table td strong,
.data-table td small {
  display: block;
}

.data-table td small {
  margin-top: 3px;
  color: var(--muted);
}

.assignee-picker {
  min-width: 170px;
}

.assignee-picker select {
  width: 100%;
  min-height: 64px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

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

.checkin-stat {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.checkin-stat span {
  color: var(--muted);
  font-size: 11px;
}

.checkin-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.checkin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.kr-editor {
  padding: 6px 16px 16px;
}

.kr-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.kr-card:last-child {
  border-bottom: 0;
}

.kr-card strong {
  font-size: 12px;
}

.kr-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.kr-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.kr-row-actions input {
  width: 82px;
}

.kr-row-actions input[data-kr-note] {
  width: 170px;
}

.db-title-cell .text-button {
  min-width: 0;
  max-width: 100%;
  padding: 0;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.data-table code {
  color: var(--ink-soft);
  font-size: 10px;
}

.activity-item {
  position: relative;
  padding: 12px 0 12px 18px;
  border-bottom: 1px solid var(--line);
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

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

.activity-item strong {
  font-size: 11px;
}

.activity-item span,
.activity-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.database-state {
  gap: 7px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.database-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.schema-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.schema-flow > div {
  min-height: 88px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.schema-flow > div span,
.schema-flow > div small {
  color: var(--muted);
  font-size: 10px;
}

.schema-flow > div strong {
  margin: 5px 0 2px;
  font-size: 13px;
}

.schema-flow > b {
  color: #9aa8a3;
}

.database-table-host {
  min-height: 280px;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.55fr);
  gap: 16px;
}

.member-directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.member-directory-toolbar input {
  width: min(420px, 60%);
}

.member-directory-toolbar span {
  color: var(--muted);
  font-size: 10px;
}

.member-table {
  padding: 0 16px 12px;
}

.member-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.member-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.member-editor-grid label,
.member-form,
.field-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.member-editor-grid label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.member-editor-grid input,
.member-editor-grid select {
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.member-save {
  align-self: end;
}

.member-readonly-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0 44px;
  color: var(--ink-soft);
  font-size: 11px;
}

.member-form {
  align-self: start;
  padding: 0 16px 16px;
}

.member-form .panel-heading {
  margin: 0 -16px 4px;
}

.permission-intro {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.permission-grid {
  padding: 0 16px 16px;
  overflow-x: auto;
}

.permission-row {
  min-width: 780px;
  display: grid;
  grid-template-columns: 180px repeat(5, minmax(100px, 1fr));
  border-bottom: 1px solid var(--line);
}

.permission-row.header {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.permission-row > div {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px;
  border-right: 1px solid var(--line);
}

.permission-cell.yes {
  color: var(--green-dark);
  background: #f3faf7;
}

.permission-cell.no {
  color: var(--muted);
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.55fr);
  gap: 16px;
}

.analysis-layout pre {
  min-height: 440px;
  margin: 0;
  padding: 18px;
  color: #dcebe5;
  background: #17251f;
  border-radius: 0 0 8px 8px;
  white-space: pre-wrap;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

.empty-work,
.empty-row {
  min-height: 120px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf1ef;
}

.login-shell {
  width: min(900px, 100%);
  min-height: 540px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(17, 35, 29, 0.14);
  overflow: hidden;
}

.login-context {
  padding: 36px;
  display: flex;
  flex-direction: column;
  color: #eef7f3;
  background: #153a30;
}

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

.login-copy {
  margin: auto 0;
}

.login-copy .eyebrow {
  color: #9fd4c2;
}

.login-copy h1 {
  max-width: 460px;
  margin-top: 10px;
  font-size: 36px;
  line-height: 1.15;
}

.login-copy p:last-child {
  max-width: 480px;
  margin-top: 16px;
  color: #bfd0ca;
  font-size: 14px;
}

.login-source-note {
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid #31594d;
}

.login-source-note span,
.login-source-note small {
  color: #9fb7ae;
  font-size: 11px;
}

.login-form {
  padding: 54px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.login-form-heading {
  margin-bottom: 6px;
}

.login-form-heading h2 {
  margin-top: 4px;
  font-size: 27px;
}

.login-form-heading p:last-child {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.login-submit {
  width: 100%;
  min-height: 44px;
}

.login-hint,
.login-error {
  font-size: 11px;
  text-align: center;
}

.login-hint {
  color: var(--muted);
}

.login-error {
  color: var(--red);
}

.auth-locked .app-shell {
  visibility: hidden;
}

.modal,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(11, 23, 19, 0.5);
}

.modal {
  display: grid;
  place-items: center;
  padding: 22px;
  overflow-y: auto;
}

.modal-panel {
  width: min(820px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(12, 28, 22, 0.25);
}

.modal-header,
.drawer-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2,
.drawer-header h2 {
  margin-top: 2px;
  font-size: 20px;
}

.okr-form {
  padding: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.span-2 {
  grid-column: span 2;
}

.field-control textarea {
  resize: vertical;
}

.form-section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 0 10px;
}

.kr-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px;
  gap: 10px;
  margin-bottom: 10px;
}

.form-footer {
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 70;
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: -18px 0 50px rgba(12, 28, 22, 0.18);
}

.drawer-body {
  min-height: 0;
  flex: 1;
  padding: 18px;
  overflow-y: auto;
}

.drawer-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-section:first-child {
  padding-top: 0;
}

.drawer-section h3 {
  margin-bottom: 12px;
  font-size: 14px;
}

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

.drawer-list-item {
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.drawer-list-item > strong,
.drawer-list-item > span {
  display: block;
}

.drawer-list-item > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: 360px;
  padding: 11px 14px;
  color: #ffffff;
  background: #1b2c26;
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .dashboard-primary-grid,
  .dashboard-secondary-grid,
  .personal-work-layout,
  .checkin-layout,
  .analysis-layout,
  .team-layout {
    grid-template-columns: 1fr;
  }

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

  .member-form {
    max-width: none;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-width: 76px;
  }

  .sidebar {
    padding: 14px 9px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand > span:last-child,
  .cycle-card,
  .nav-section-label,
  .nav-item:not(.active) > span,
  .nav-item.active > span,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
    padding: 7px;
  }

  .nav-item > span {
    width: 30px;
    height: 30px;
    font-size: 9px;
  }

  .identity-card .member-name,
  .identity-meta,
  .identity-card .text-button,
  .status-card span:last-child {
    display: none;
  }

  .identity-card {
    display: grid;
    place-items: center;
  }

  .page-canvas {
    padding: 20px 18px 36px;
  }

  .workspace-header {
    padding: 12px 18px;
  }

  .workspace-subtitle,
  .workspace-eyebrow {
    display: none;
  }

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

  .inline-actions input {
    width: 100%;
  }

  .data-commandbar,
  .okr-page-heading,
  .database-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .schema-flow > b {
    display: none;
  }

  .my-task-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }

  .my-task-due,
  .my-task-row select {
    display: none;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-context {
    min-height: 230px;
    padding: 26px;
  }

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

  .login-source-note {
    display: none;
  }

  .login-form {
    padding: 34px 28px;
  }
}

@media (max-width: 640px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: 64px;
    display: block;
    padding: 7px;
    overflow-x: auto;
    border: 0;
    border-top: 1px solid #2c423a;
  }

  .brand,
  .identity-card,
  .status-card,
  .cycle-card,
  .nav-section-label {
    display: none;
  }

  .nav-list {
    height: 50px;
    flex-direction: row;
    gap: 5px;
  }

  .nav-item {
    flex: 0 0 48px;
    width: 48px;
    min-height: 48px;
  }

  .main-panel {
    grid-column: 1;
    padding-bottom: 70px;
  }

  .workspace-header {
    min-height: 66px;
    padding: 10px 14px;
  }

  .workspace-heading h1 {
    font-size: 17px;
  }

  .topbar-actions .secondary-button {
    display: none;
  }

  .topbar-actions .primary-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .page-canvas {
    padding: 14px 12px 28px;
  }

  .metrics-grid,
  .personal-metrics,
  .checkin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric,
  .personal-metrics article {
    min-height: 104px;
    padding: 13px;
  }

  .metric strong,
  .personal-metrics strong {
    font-size: 23px;
  }

  .chart-controls,
  .panel-heading,
  .member-directory-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .view-tabs,
  .data-scope-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .view-tab,
  .scope-tab {
    flex: 1 0 auto;
  }

  .objective-group-head {
    flex-direction: column;
  }

  .objective-meta-stack {
    width: 100%;
    justify-content: space-between;
  }

  .objective-submeta {
    flex-wrap: wrap;
  }

  .member-editor-grid,
  .two-columns,
  .drawer-grid,
  .kr-input-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .member-directory-toolbar input {
    width: 100%;
  }

  .schema-flow {
    grid-template-columns: 1fr;
  }

  .kr-card {
    grid-template-columns: 1fr;
  }

  .kr-row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .kr-row-actions input {
    width: 100%;
  }

  .login-screen {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .login-context {
    min-height: 200px;
  }
}
