/* QM175 product UI refresh. This layer intentionally preserves the existing
   component contract while replacing the earlier visual treatment. */

:root {
  --qm-ink: #17211d;
  --qm-ink-soft: #4f5d57;
  --qm-muted: #748079;
  --qm-line: #dfe5e1;
  --qm-line-soft: #edf1ee;
  --qm-surface: #ffffff;
  --qm-canvas: #f4f6f4;
  --qm-sidebar: #f9faf8;
  --qm-green: #087b68;
  --qm-green-dark: #075d51;
  --qm-green-soft: #e4f4ef;
  --qm-blue: #2f64d6;
  --qm-blue-soft: #eaf0fd;
  --qm-amber: #b96b08;
  --qm-amber-soft: #fff3df;
  --qm-red: #bb3f46;
  --qm-red-soft: #fdebed;
  --qm-violet: #6f54b5;
  --qm-violet-soft: #f0ecfb;
  --qm-shadow-sm: 0 1px 2px rgba(22, 33, 28, 0.05);
  --qm-shadow-md: 0 10px 28px rgba(29, 42, 35, 0.08);
  --qm-sidebar-width: 252px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
  background: var(--qm-canvas);
}

body {
  margin: 0;
  color: var(--qm-ink);
  background: var(--qm-canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

::selection {
  color: var(--qm-ink);
  background: #c8ebe1;
}

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

/* Application frame */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--qm-sidebar-width) minmax(0, 1fr);
  background: var(--qm-canvas);
}

.sidebar {
  position: sticky;
  inset: auto;
  top: 0;
  z-index: 30;
  width: var(--qm-sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  overflow: hidden auto;
  color: var(--qm-ink);
  background: var(--qm-sidebar);
  border-right: 1px solid var(--qm-line);
}

.brand {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 7px;
  color: var(--qm-ink);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  color: #fff;
  background: var(--qm-green);
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.brand > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 15px;
  font-weight: 760;
}

.brand small {
  color: var(--qm-muted);
  font-size: 11px;
  font-weight: 550;
}

.cycle-card {
  display: grid;
  gap: 3px;
  margin: 15px 7px 14px;
  padding: 12px;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-radius: 7px;
  box-shadow: var(--qm-shadow-sm);
}

.cycle-card span,
.cycle-card small {
  color: var(--qm-muted);
  font-size: 10px;
}

.cycle-card span {
  text-transform: uppercase;
  font-weight: 750;
}

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

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

.nav-section-label {
  margin: 13px 10px 4px;
  color: #98a19c;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 39px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #53615a;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  font-size: 12px;
  font-weight: 620;
  transition: color 150ms ease, background 150ms ease;
}

.nav-item > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #8b9690;
  background: transparent;
  border-radius: 5px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.nav-item:hover {
  color: var(--qm-ink);
  background: #eef2ef;
}

.nav-item.active {
  color: var(--qm-green-dark);
  background: var(--qm-green-soft);
  font-weight: 720;
}

.nav-item.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -14px;
  width: 3px;
  content: "";
  background: var(--qm-green);
  border-radius: 0 3px 3px 0;
}

.nav-item.active > span {
  color: var(--qm-green-dark);
  background: rgba(255, 255, 255, 0.66);
}

.identity-card {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 13px 7px 10px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--qm-line);
  border-radius: 0;
}

.signed-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  color: #fff;
  background: var(--qm-green);
  border: 0;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 780;
}

.member-name {
  min-width: 0;
  display: grid;
  gap: 1px;
}

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

.member-name strong {
  font-size: 12px;
  font-weight: 720;
}

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

.identity-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--qm-muted);
  font-size: 10px;
}

.role-pill,
.hint-pill,
.live-badge,
.count-pill,
.source-badge,
.data-freshness {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 3px 8px;
  color: var(--qm-green-dark);
  background: var(--qm-green-soft);
  border: 0;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 720;
}

.sidebar .text-button {
  min-height: 31px;
  padding: 5px 9px;
  color: var(--qm-muted);
  background: transparent;
  border: 1px solid var(--qm-line);
  border-radius: 6px;
  font-size: 10px;
}

.sidebar .text-button:hover {
  color: var(--qm-red);
  border-color: #e6c4c7;
  background: var(--qm-red-soft);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 7px 0;
  padding: 7px 0 0;
  color: var(--qm-muted);
  background: transparent;
  border: 0;
  font-size: 9px;
}

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

.status-dot.online,
.status-dot.ok {
  background: var(--qm-green);
}

.status-dot.bad {
  background: var(--qm-red);
}

.main-panel {
  min-width: 0;
  background: var(--qm-canvas);
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(22px, 3vw, 42px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--qm-line);
  backdrop-filter: blur(14px);
}

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

.workspace-eyebrow,
.eyebrow {
  margin: 0 0 3px;
  color: var(--qm-green);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-heading h1 {
  margin: 0;
  color: var(--qm-ink);
  font-size: 22px;
  font-weight: 760;
  line-height: 1.2;
}

.workspace-subtitle {
  max-width: 760px;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--qm-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions,
.inline-actions,
.chart-controls,
.toolbar-filters,
.data-scope-tabs,
.view-tabs {
  display: flex;
  align-items: center;
  gap: 7px;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.icon-button {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 690;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.primary-button {
  color: #fff;
  background: var(--qm-green);
  border: 1px solid var(--qm-green);
  box-shadow: var(--qm-shadow-sm);
}

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

.secondary-button,
.ghost-button {
  color: #34423b;
  background: #fff;
  border: 1px solid #ced7d2;
  box-shadow: var(--qm-shadow-sm);
}

.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  color: var(--qm-green-dark);
  background: #f5faf8;
  border-color: #93bdb1;
}

.ai-button {
  color: #5a438f;
  background: var(--qm-violet-soft);
  border-color: #d9cff0;
}

.icon-button {
  width: 34px;
  padding: 0;
  color: var(--qm-ink-soft);
  background: #fff;
  border: 1px solid var(--qm-line);
  font-size: 20px;
}

.page-canvas {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px clamp(22px, 3vw, 42px) 56px;
}

.workspace {
  display: grid;
  gap: 18px;
}

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

.context-toolbar {
  min-height: 46px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--qm-line);
}

.context-toolbar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.context-toolbar > div:first-child span {
  color: var(--qm-muted);
  font-size: 10px;
}

.context-toolbar > div:first-child strong {
  font-size: 12px;
  font-weight: 700;
}

.data-freshness {
  color: var(--qm-muted);
  background: #ecefed;
  font-weight: 600;
}

/* Dashboard */
.metrics-grid,
.personal-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric,
.personal-metrics > article {
  min-width: 0;
  min-height: 108px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  gap: 7px 10px;
  padding: 16px 17px;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-radius: 7px;
  box-shadow: var(--qm-shadow-sm);
}

.metric > span,
.personal-metrics > article > span {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  padding-right: 36px;
  color: var(--qm-ink-soft);
  font-size: 10px;
  font-weight: 740;
  text-transform: uppercase;
}

.metric > strong,
.personal-metrics > article > strong {
  grid-column: 1 / -1;
  color: var(--qm-ink);
  font-size: 30px;
  font-weight: 730;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric > small,
.personal-metrics > article > small {
  grid-column: 1 / -1;
  color: var(--qm-muted);
  font-size: 9px;
}

.metric::before,
.personal-metrics > article::before {
  grid-column: 1;
  grid-row: 1;
  width: 7px;
  height: 7px;
  align-self: center;
  content: "";
  background: var(--qm-green);
  border-radius: 50%;
}

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

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

.metric:nth-child(4)::before,
.personal-metrics > article:nth-child(3)::before {
  background: var(--qm-violet);
}

.dashboard-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 12px;
}

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

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

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

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

.panel-heading > div:first-child > span {
  color: var(--qm-muted);
  font-size: 9px;
  font-weight: 740;
  text-transform: uppercase;
}

.panel-heading > div:first-child > strong {
  overflow: hidden;
  color: var(--qm-ink);
  font-size: 14px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-controls select,
.data-commandbar select,
.data-commandbar input,
.member-directory-toolbar input,
.my-task-row select,
.kr-row-actions select,
.kr-row-actions input,
.field-control input,
.field-control select,
.field-control textarea {
  min-height: 35px;
  color: var(--qm-ink);
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 6px;
  outline: none;
}

.chart-controls select,
.data-commandbar select {
  padding: 6px 31px 6px 10px;
}

.chart-controls select:focus,
.data-commandbar select:focus,
.data-commandbar input:focus,
.member-directory-toolbar input:focus,
.field-control input:focus,
.field-control select:focus,
.field-control textarea:focus {
  border-color: #63a899;
  box-shadow: 0 0 0 3px rgba(8, 123, 104, 0.1);
}

.chart-board {
  min-height: 265px;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 20px 18px 22px;
}

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

.chart-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  color: var(--qm-ink-soft);
  font-size: 10px;
}

.chart-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-label strong {
  color: var(--qm-ink);
  font-variant-numeric: tabular-nums;
}

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

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

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

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

.chart-bar.tone-3 {
  background: var(--qm-violet);
}

.risk-list,
.team-progress {
  display: grid;
  gap: 0;
  padding: 3px 16px 9px;
}

.risk-line,
.team-line {
  width: 100%;
  min-width: 0;
  padding: 13px 0;
  color: inherit;
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-bottom: 1px solid var(--qm-line-soft);
  text-align: left;
}

.risk-line:hover,
.team-line:hover {
  background: #f8faf8;
}

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

.risk-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.risk-line > div,
.team-line-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.risk-line strong,
.team-line strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 680;
  text-overflow: ellipsis;
}

.risk-line span:not(.status-pill),
.team-line span {
  color: var(--qm-muted);
  font-size: 9px;
}

.team-line-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 9px;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px;
}

.summary-stat {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 13px;
  border-right: 1px solid var(--qm-line-soft);
  border-bottom: 1px solid var(--qm-line-soft);
}

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

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

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

.summary-stat strong {
  font-size: 21px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

/* Portfolio */
.data-commandbar {
  flex-wrap: wrap;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--qm-line);
  border-radius: 7px;
  box-shadow: var(--qm-shadow-sm);
}

.view-tabs,
.data-scope-tabs {
  padding: 3px;
  background: #edf1ee;
  border: 0;
  border-radius: 6px;
}

.view-tab,
.scope-tab {
  min-height: 30px;
  padding: 5px 10px;
  color: var(--qm-muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 660;
}

.view-tab.active,
.scope-tab.active {
  color: var(--qm-ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(22, 33, 28, 0.09);
}

.data-commandbar .inline-actions {
  min-width: min(100%, 600px);
  margin-left: auto;
}

.data-commandbar input {
  width: min(320px, 42vw);
  padding: 7px 10px;
}

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

.okr-page-heading > div:first-child,
.database-heading > div:first-child {
  min-width: 0;
}

.okr-page-heading h2,
.database-heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 750;
}

.okr-page-heading p:not(.eyebrow),
.database-heading p:not(.eyebrow) {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--qm-muted);
  font-size: 10px;
}

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

.okr-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--qm-line);
  border-radius: 7px;
  box-shadow: var(--qm-shadow-sm);
}

.objective-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 16px 18px 10px;
}

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

.objective-title-line h3 {
  margin: 0;
  overflow: hidden;
  color: var(--qm-ink);
  font-size: 14px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.objective-group-head p {
  max-width: 900px;
  margin: 7px 0 0 27px;
  color: var(--qm-muted);
  font-size: 10px;
}

.row-icon {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  flex: 0 0 19px;
  color: var(--qm-green);
  background: var(--qm-green-soft);
  border-radius: 50%;
  font-size: 9px;
}

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

.progress-ring {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  background: conic-gradient(var(--qm-green) var(--progress), #e7ece9 0);
  border-radius: 50%;
}

.progress-ring::before {
  width: 34px;
  height: 34px;
  grid-area: 1 / 1;
  content: "";
  background: #fff;
  border-radius: 50%;
}

.progress-ring strong {
  z-index: 1;
  grid-area: 1 / 1;
  font-size: 9px;
  font-weight: 760;
}

.objective-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 18px 12px 45px;
}

.objective-submeta span {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  color: var(--qm-muted);
  background: #f1f4f2;
  border-radius: 4px;
  font-size: 9px;
}

.objective-progress {
  padding: 0 18px 13px;
}

.db-table {
  min-width: 760px;
  overflow: hidden;
  border-top: 1px solid var(--qm-line-soft);
}

.db-row {
  min-height: 45px;
  display: grid;
  grid-template-columns: minmax(300px, 2fr) minmax(145px, 0.9fr) minmax(130px, 0.8fr) 70px 100px 110px;
  align-items: center;
  color: var(--qm-ink-soft);
  border-bottom: 1px solid var(--qm-line-soft);
  font-size: 10px;
}

.db-row > div {
  min-width: 0;
  padding: 9px 12px;
}

.db-head {
  min-height: 34px;
  color: var(--qm-muted);
  background: #f7f9f7;
  font-size: 8px;
  font-weight: 780;
  text-transform: uppercase;
}

.db-title-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

.db-title-cell .text-button {
  min-width: 0;
  min-height: 28px;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
  color: var(--qm-ink);
  background: transparent;
  border: 0;
  font-size: 10px;
  text-align: left;
  text-overflow: ellipsis;
}

.db-progress-cell {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  font-variant-numeric: tabular-nums;
}

.okr-card > .inline-actions {
  justify-content: flex-end;
  padding: 10px 14px;
  background: #fafbfa;
}

.okr-card > .inline-actions .primary-button,
.okr-card > .inline-actions .ghost-button {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 9px;
}

.status-pill {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  color: #246355;
  background: var(--qm-green-soft);
  border: 0;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 740;
  white-space: nowrap;
}

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

.status-pill.draft,
.status-pill.todo,
.status-pill.archived {
  color: #616d67;
  background: #edf0ee;
}

.status-pill.done {
  color: #315dab;
  background: var(--qm-blue-soft);
}

/* Personal work and check-ins */
.personal-work-layout,
.checkin-layout,
.team-layout,
.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
  gap: 12px;
  align-items: start;
}

.my-work-list,
.my-okr-list,
.kr-editor,
.activity-timeline {
  display: grid;
  gap: 0;
  padding: 2px 16px 10px;
}

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

.task-state-dot {
  width: 7px;
  height: 7px;
  background: #a9b2ad;
  border-radius: 50%;
}

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

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

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

.my-task-main,
.my-task-due,
.my-okr-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.my-task-main strong,
.my-okr-row strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 670;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-task-main span,
.my-task-due span,
.my-okr-row span {
  overflow: hidden;
  color: var(--qm-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-task-due strong {
  font-size: 10px;
  font-weight: 650;
}

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

.compact-button {
  min-height: 30px;
  padding: 4px 8px;
}

.my-okr-row {
  min-height: 67px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--qm-line-soft);
}

.compact-ring {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.compact-ring::before {
  width: 28px;
  height: 28px;
}

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

.checkin-stat {
  min-height: 86px;
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--qm-line);
  border-radius: 7px;
}

.checkin-stat span {
  color: var(--qm-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.checkin-stat strong {
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.kr-card,
.activity-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--qm-line-soft);
}

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

/* Database, team and permissions */
.schema-flow {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  justify-content: stretch;
  gap: 8px;
}

.schema-flow > div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--qm-line);
  border-radius: 7px;
}

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

.schema-flow > div strong {
  font-size: 12px;
}

.schema-flow > b {
  color: #a3aca7;
  text-align: center;
}

.database-state {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  color: var(--qm-green-dark);
  background: var(--qm-green-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

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

.database-table-host,
.member-table {
  overflow: auto;
}

.data-table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 10px;
}

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

.data-table th {
  position: sticky;
  top: 0;
  color: var(--qm-muted);
  background: #f7f9f7;
  font-size: 8px;
  text-transform: uppercase;
}

.directory-panel {
  min-width: 0;
}

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

.member-directory-toolbar input {
  width: min(360px, 55%);
  padding: 7px 10px;
}

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

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

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

.member-row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.member-editor-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.3fr 1fr 1fr 0.8fr 0.7fr;
  gap: 7px;
}

.member-editor-grid input,
.member-editor-grid select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 5px;
  font-size: 9px;
}

.member-form {
  position: sticky;
  top: 106px;
  display: grid;
  gap: 12px;
  padding-bottom: 16px;
}

.member-form > .field-control,
.member-form > button {
  margin-right: 16px;
  margin-left: 16px;
}

.permission-panel {
  overflow: hidden;
}

.permission-intro {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 15px;
  padding: 14px 16px;
  color: var(--qm-ink-soft);
  background: var(--qm-green-soft);
  font-size: 10px;
}

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

.permission-row {
  min-width: 820px;
  display: grid;
  grid-template-columns: 180px repeat(4, minmax(130px, 1fr));
  border-bottom: 1px solid var(--qm-line-soft);
}

.permission-cell {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 10px;
}

/* Forms, drawer and modal */
.field-control {
  display: grid;
  gap: 5px;
}

.field-control > span {
  color: var(--qm-ink-soft);
  font-size: 9px;
  font-weight: 690;
}

.field-control input,
.field-control select,
.field-control textarea {
  width: 100%;
  padding: 8px 10px;
  resize: vertical;
}

.modal,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(19, 29, 24, 0.46);
  backdrop-filter: blur(3px);
}

.modal {
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-panel {
  width: min(880px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 25, 20, 0.24);
}

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

.modal-header h2,
.drawer-header h2 {
  margin: 0;
  font-size: 17px;
}

.okr-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

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

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

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

.form-section-heading,
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid var(--qm-line-soft);
}

.form-section-heading span {
  color: var(--qm-muted);
  font-size: 9px;
}

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

.drawer-backdrop {
  z-index: 109;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  width: min(720px, 94vw);
  overflow: hidden;
  background: #fff;
  border-left: 1px solid var(--qm-line);
  box-shadow: -18px 0 54px rgba(20, 31, 25, 0.14);
}

.drawer-body {
  height: calc(100vh - 69px);
  overflow: auto;
  padding: 18px;
}

.drawer-section {
  margin-bottom: 14px;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--qm-line);
  border-radius: 7px;
}

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

.drawer-list-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--qm-line-soft);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  max-width: min(360px, calc(100vw - 44px));
  padding: 11px 14px;
  color: #fff;
  background: #1d2b24;
  border-radius: 6px;
  box-shadow: var(--qm-shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 11px;
}

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

.analysis-layout .wide {
  min-height: 420px;
}

#analysisOutput {
  min-height: 330px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #dbe9e3;
  background: #17251f;
  border-radius: 0 0 7px 7px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.muted {
  color: var(--qm-muted);
  font-size: 10px;
}

/* Login */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: #edf1ee;
}

.login-shell {
  width: min(1040px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, 0.75fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid #d6ded9;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(22, 35, 29, 0.14);
}

.login-context {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px 42px;
  overflow: hidden;
  color: #f5fbf8;
  background: linear-gradient(158deg, #1b483c 0%, #133127 56%, #0c221c 100%);
}

.login-context::after {
  position: absolute;
  right: -80px;
  bottom: -125px;
  width: 410px;
  height: 300px;
  content: "175";
  color: rgba(255, 255, 255, 0.05);
  font-size: 210px;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand .brand-mark {
  color: var(--qm-green-dark);
  background: #fff;
}

.login-brand > div {
  display: grid;
}

.login-brand strong {
  color: #fff;
  font-size: 16px;
}

.login-brand span {
  color: #bcd0c8;
  font-size: 11px;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: auto 0;
  padding: 70px 0;
}

.login-copy .eyebrow {
  color: #7ed1bd;
}

.login-copy h1 {
  margin: 10px 0 15px;
  color: #fff;
  font-size: 38px;
  font-weight: 710;
  line-height: 1.14;
  letter-spacing: -0.6px;
}

.login-copy p:last-child {
  max-width: 500px;
  margin: 0;
  color: #c4d6ce;
  font-size: 14px;
  line-height: 1.65;
}

.login-source-note {
  position: relative;
  z-index: 1;
  width: fit-content;
  display: grid;
  gap: 3px;
  padding-left: 12px;
  border-left: 2px solid #55bca4;
}

.login-source-note span,
.login-source-note small {
  color: #a6c0b7;
  font-size: 10px;
}

.login-source-note strong {
  color: #fff;
  font-size: 12px;
}

.login-form {
  align-self: center;
  display: grid;
  gap: 16px;
  padding: 50px 44px;
}

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

.login-form-heading h2 {
  margin: 4px 0 7px;
  font-size: 25px;
  font-weight: 740;
}

.login-form-heading p:last-child {
  margin: 0;
  color: var(--qm-muted);
  font-size: 11px;
  line-height: 1.55;
}

.login-submit {
  min-height: 41px;
  margin-top: 3px;
}

.login-hint,
.login-error {
  margin: 0;
  font-size: 11px;
}

.login-hint {
  color: var(--qm-muted);
  text-align: center;
}

.login-error {
  padding: 9px 10px;
  color: #8f3037;
  background: var(--qm-red-soft);
  border-radius: 5px;
}

/* Responsive */
@media (max-width: 1180px) {
  :root {
    --qm-sidebar-width: 224px;
  }

  .dashboard-primary-grid,
  .personal-work-layout,
  .checkin-layout,
  .analysis-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .member-form {
    position: static;
  }

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

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    inset: auto;
    top: 0;
    width: 100%;
    height: auto;
    max-height: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--qm-line);
  }

  .brand {
    min-height: 42px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

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

  .nav-list {
    min-width: 0;
    display: flex;
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .nav-item {
    width: auto;
    min-width: max-content;
    min-height: 34px;
    grid-template-columns: auto 1fr;
    padding: 5px 8px;
    font-size: 10px;
  }

  .nav-item > span {
    width: 20px;
    height: 20px;
  }

  .nav-item.active::before {
    display: none;
  }

  .workspace-header {
    position: relative;
    padding: 14px 18px;
  }

  .workspace-subtitle {
    display: none;
  }

  .page-canvas {
    padding: 18px;
  }

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

  .dashboard-secondary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-shell {
    min-height: 560px;
    grid-template-columns: minmax(0, 0.9fr) minmax(350px, 1.1fr);
  }

  .login-context {
    padding: 28px;
  }

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

@media (max-width: 680px) {
  .sidebar {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .brand {
    display: none;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

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

  .topbar-actions {
    width: 100%;
    overflow-x: auto;
  }

  .topbar-actions > button {
    flex: 1 0 max-content;
  }

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

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

  .context-toolbar > div:first-child {
    display: grid;
  }

  .data-commandbar .inline-actions,
  .chart-controls,
  .data-scope-tabs,
  .view-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .data-commandbar .inline-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .data-commandbar input,
  .data-commandbar select,
  .member-directory-toolbar input {
    width: 100%;
  }

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

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

  .metric > strong,
  .personal-metrics > article > strong {
    font-size: 25px;
  }

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

  .chart-controls select {
    min-width: 150px;
    flex: 1 0 auto;
  }

  .objective-group-head {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .objective-title-line h3 {
    white-space: normal;
  }

  .objective-group-head p {
    margin-left: 0;
  }

  .objective-submeta {
    padding-left: 18px;
  }

  .okr-card {
    overflow-x: auto;
  }

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

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

  .member-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .schema-flow > b {
    transform: rotate(90deg);
  }

  .two-columns,
  .drawer-grid,
  .kr-input-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .login-screen {
    padding: 0;
    place-items: stretch;
  }

  .login-shell {
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr);
    border: 0;
    border-radius: 0;
  }

  .login-context {
    min-height: 245px;
    padding: 24px;
  }

  .login-copy {
    padding: 32px 0 20px;
  }

  .login-copy h1 {
    max-width: 420px;
    font-size: 26px;
  }

  .login-copy p:last-child,
  .login-source-note {
    display: none;
  }

  .login-form {
    align-self: start;
    padding: 35px 24px 50px;
  }
}

/* Tactile depth system */
:root {
  --qm-depth-edge: #d4ddd8;
  --qm-depth-green: #065648;
  --qm-shadow-depth: 0 4px 0 var(--qm-depth-edge), 0 12px 24px rgba(25, 42, 33, 0.09);
}

.sidebar {
  box-shadow: 10px 0 28px rgba(28, 47, 37, 0.045);
}

.brand-mark {
  transform: translateY(-2px) rotate(-2deg);
  box-shadow: 0 4px 0 var(--qm-depth-green), 0 8px 14px rgba(8, 89, 74, 0.16);
}

.cycle-card {
  border-bottom-color: #cbd7d1;
  box-shadow: 0 3px 0 #d9e1dd, 0 8px 18px rgba(31, 48, 39, 0.05);
}

.primary-button,
.secondary-button,
.ghost-button {
  transform: translateY(-1px);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  box-shadow: 0 3px 0 var(--qm-depth-green), 0 7px 12px rgba(8, 89, 74, 0.12);
}

.secondary-button,
.ghost-button {
  box-shadow: 0 3px 0 #d5ddd9, 0 7px 12px rgba(27, 44, 35, 0.06);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.ghost-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--qm-depth-edge);
}

.metrics-grid,
.personal-metrics,
.dashboard-primary-grid,
.dashboard-secondary-grid {
  perspective: 1100px;
}

.metric,
.personal-metrics > article {
  position: relative;
  overflow: hidden;
  border-bottom-color: #cbd6d0;
  box-shadow: var(--qm-shadow-depth);
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.metric::after,
.personal-metrics > article::after {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 28px;
  height: 28px;
  content: "";
  background: #eef7f4;
  border: 1px solid #d5ebe4;
  border-radius: 6px;
  box-shadow: inset -4px -4px 0 rgba(8, 123, 104, 0.06), 0 3px 0 #d5e4df;
  transform: rotate(7deg);
}

.metric:nth-child(2)::after {
  background: var(--qm-blue-soft);
  border-color: #d4def6;
}

.metric.risk::after {
  background: var(--qm-red-soft);
  border-color: #f1d0d3;
}

.metric:nth-child(4)::after {
  background: var(--qm-violet-soft);
  border-color: #ded5f2;
}

.metric:hover,
.personal-metrics > article:hover {
  z-index: 2;
  transform: translateY(-3px) rotateX(1deg);
  box-shadow: 0 6px 0 var(--qm-depth-edge), 0 17px 30px rgba(25, 42, 33, 0.12);
}

.dashboard-primary-grid > .panel,
.dashboard-secondary-grid > .panel,
.team-layout > .panel,
.permission-panel,
.database-panel {
  border-bottom-color: #cbd6d0;
  box-shadow: 0 4px 0 #d8e0dc, 0 14px 28px rgba(26, 43, 34, 0.07);
}

.panel-heading {
  background: #fbfcfb;
  box-shadow: inset 0 -1px 0 #e7ece9;
}

.chart-track,
.progress-track {
  border: 1px solid #dfe6e2;
  box-shadow: inset 0 2px 4px rgba(20, 40, 30, 0.08);
}

.chart-bar,
.progress-fill {
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(7, 93, 81, 0.22);
}

.okr-card {
  border-bottom-color: #c8d4ce;
  box-shadow: 0 4px 0 #d9e1dd, 0 12px 24px rgba(29, 46, 37, 0.065);
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.okr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #d4ddd8, 0 17px 28px rgba(29, 46, 37, 0.09);
}

.progress-ring {
  border: 1px solid #d5ded9;
  box-shadow: 0 4px 0 #d9e1dd, 0 8px 14px rgba(31, 49, 39, 0.08);
  transform: rotateX(8deg);
}

.field-control input,
.field-control select,
.field-control textarea,
.member-directory-toolbar input {
  box-shadow: inset 0 2px 3px rgba(27, 43, 35, 0.055), 0 1px 0 #fff;
}

.identity-actions,
.member-row-actions {
  display: flex;
  gap: 7px;
}

.mobile-account-button {
  display: none;
}

.identity-actions > button {
  min-width: 0;
  flex: 1;
}

.sidebar .identity-actions .text-button:first-child:hover {
  color: var(--qm-green-dark);
  background: var(--qm-green-soft);
  border-color: #b8d8cf;
}

.member-security-state {
  min-height: 53px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 7px 9px;
  background: #f7f9f8;
  border: 1px solid var(--qm-line);
  border-radius: 6px;
}

.member-security-state span,
.form-note {
  color: var(--qm-muted);
  font-size: 9px;
}

.member-security-state strong {
  color: var(--qm-green-dark);
  font-size: 10px;
}

.member-row-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.form-note {
  margin: -4px 0 0;
  line-height: 1.45;
}

.password-panel {
  width: min(500px, calc(100vw - 28px));
  box-shadow: 0 8px 0 #cbd6d0, 0 28px 70px rgba(20, 35, 27, 0.22);
}

.security-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.security-notice {
  margin: 0;
  padding: 14px 18px;
  color: var(--qm-ink-soft);
  background: #f4f8f6;
  border-bottom: 1px solid var(--qm-line);
  font-size: 11px;
}

.forced-password-change .security-notice {
  color: #6e4208;
  background: var(--qm-amber-soft);
}

.check-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--qm-ink-soft);
  font-size: 11px;
}

.check-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--qm-green);
}

.password-strength {
  color: var(--qm-muted);
  font-size: 10px;
}

.password-strength[data-level="3"],
.password-strength[data-level="4"] {
  color: var(--qm-green-dark);
  font-weight: 700;
}

.login-screen {
  perspective: 1400px;
}

.login-shell {
  border-color: #d8e0db;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(22, 35, 29, 0.06), 0 30px 70px -22px rgba(11, 46, 38, 0.34);
  transform: none;
}

.login-context {
  perspective: 900px;
}

.login-copy {
  max-width: 360px;
  padding: 48px 0 185px;
}

.login-visual-stack {
  position: absolute;
  z-index: 2;
  right: 38px;
  bottom: 76px;
  width: 280px;
  height: 176px;
  transform: rotateX(7deg) rotateY(-9deg) rotateZ(1deg);
  transform-style: preserve-3d;
}

.visual-card {
  position: absolute;
  width: 220px;
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 15px 17px;
  color: var(--qm-ink);
  background: #fff;
  border: 1px solid #cbd8d2;
  border-radius: 7px;
  box-shadow: 0 6px 0 rgba(6, 65, 54, 0.34), 0 17px 28px rgba(4, 37, 31, 0.24);
  transform-style: preserve-3d;
}

.visual-card span,
.visual-card i {
  color: var(--qm-muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: 0.3px;
}

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

.visual-card-back {
  top: 0;
  left: 0;
  opacity: 0.72;
  transform: translateZ(-40px) translate(-20px, -12px);
}

.visual-card-middle {
  top: 30px;
  left: 27px;
  opacity: 0.88;
  transform: translateZ(-16px);
}

.visual-card-front {
  top: 70px;
  left: 57px;
  grid-template-columns: 1fr auto;
  background: #f8fcfa;
  transform: translateZ(22px);
}

.visual-card-front strong {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--qm-green-dark);
  font-size: 27px;
}

.visual-progress {
  height: 7px;
  overflow: hidden;
  background: #e3eae6;
  border-radius: 999px;
  box-shadow: inset 0 2px 3px rgba(20, 40, 30, 0.1);
}

.visual-progress b {
  height: 100%;
  display: block;
  background: var(--qm-green);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28);
}

@media (max-width: 900px) {
  .topbar-actions .mobile-account-button {
    display: inline-flex;
  }

  .login-visual-stack {
    right: 18px;
    bottom: 66px;
    transform: scale(0.78) rotateX(7deg) rotateY(-9deg) rotateZ(1deg);
    transform-origin: right bottom;
  }

  .login-copy {
    padding-bottom: 150px;
  }
}

@media (max-width: 680px) {
  .login-shell {
    transform: none;
    box-shadow: none;
  }

  .login-visual-stack {
    display: none;
  }

  .login-copy {
    padding: 32px 0 20px;
  }

  .metric:hover,
  .personal-metrics > article:hover,
  .okr-card:hover {
    transform: none;
  }

  .member-row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-actions {
    padding-bottom: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button,
  .secondary-button,
  .ghost-button,
  .metric,
  .personal-metrics > article,
  .okr-card {
    transition: none;
  }
}

/* ============================================================
   QM175 — Lớp tinh chỉnh cao cấp (premium polish).
   Phủ lên trên hệ thống hiện có. Chỉ thay đổi hình thức:
   không đổi markup, không đổi logic, không đụng dữ liệu.
   ============================================================ */
:root {
  --qm-shadow-sm: 0 1px 2px rgba(20, 40, 33, 0.06);
  --qm-shadow-md: 0 4px 14px -4px rgba(20, 40, 33, 0.10), 0 16px 38px -10px rgba(20, 40, 33, 0.10);
  --qm-radius-card: 11px;
  --qm-radius-control: 8px;
}

/* Hình khối card mềm và hiện đại hơn */
.panel,
.metric,
.personal-metrics > article,
.okr-card,
.member-form,
.directory-panel,
.permission-panel,
.analysis-layout .panel,
.data-table-wrap,
.kr-editor,
.schema-flow > div {
  border-radius: var(--qm-radius-card);
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.icon-button,
.ai-button,
.compact-button,
.field-control input,
.field-control select,
.field-control textarea,
.data-commandbar input,
.data-commandbar select,
.chart-controls select,
.member-directory-toolbar input,
.status-pill,
.hint-pill,
.role-pill {
  border-radius: var(--qm-radius-control);
}

/* Card có chiều sâu, nhấc nhẹ khi hover cho cảm giác "đắt tiền" */
.panel {
  box-shadow: var(--qm-shadow-sm);
  transition: box-shadow 170ms ease, border-color 170ms ease, transform 170ms ease;
}

.panel:hover {
  border-color: #d2ddd7;
  box-shadow: var(--qm-shadow-md);
}

.metric,
.personal-metrics > article {
  box-shadow: var(--qm-shadow-sm);
}

/* Micro-label dễ đọc hơn, bớt cảm giác chữ li ti */
.workspace-eyebrow,
.eyebrow,
.panel-heading > div:first-child > span,
.metric > small,
.personal-metrics > article > small,
.context-toolbar > div:first-child span {
  font-size: 10px;
  letter-spacing: 0.3px;
}

.workspace-subtitle {
  font-size: 12px;
}

.panel-heading > div:first-child > strong {
  font-size: 14.5px;
}

/* Con số lớn sắc nét hơn */
.metric > strong,
.personal-metrics > article > strong {
  letter-spacing: -0.6px;
}

/* Nút chính có độ nổi tinh tế */
.primary-button {
  box-shadow: 0 1px 2px rgba(7, 93, 81, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.primary-button:hover:not(:disabled) {
  box-shadow: 0 4px 12px -3px rgba(7, 93, 81, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* Status pill rõ ràng, cân đối hơn */
.status-pill,
.hint-pill,
.role-pill {
  padding: 3px 9px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Thanh tiến độ dày hơn chút cho dễ nhìn */
.chart-track,
.progress-track {
  height: 8px;
}

/* Đồng bộ về phẳng – mềm, khớp với màn đăng nhập mới.
   Vô hiệu hoá motif bóng gờ / 3D cũ để cả app nhất quán. */
.workspace-header {
  background: #ffffff;
  backdrop-filter: none;
}

.brand-mark {
  transform: none;
  box-shadow: 0 1px 2px rgba(8, 89, 74, 0.18);
}

.cycle-card {
  box-shadow: var(--qm-shadow-sm);
}

.primary-button,
.secondary-button,
.ghost-button {
  transform: none;
}

.secondary-button,
.ghost-button {
  box-shadow: var(--qm-shadow-sm);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.ghost-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: var(--qm-shadow-sm);
}

.metric,
.personal-metrics > article {
  box-shadow: var(--qm-shadow-sm);
  transform: none;
}

.metric::after,
.personal-metrics > article::after {
  display: none;
}

.metric:hover,
.personal-metrics > article:hover {
  transform: translateY(-2px);
  box-shadow: var(--qm-shadow-md);
}

.dashboard-primary-grid > .panel,
.dashboard-secondary-grid > .panel,
.team-layout > .panel,
.permission-panel,
.database-panel {
  box-shadow: var(--qm-shadow-sm);
}

.okr-card {
  box-shadow: var(--qm-shadow-sm);
}

.okr-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--qm-shadow-md);
}

.progress-ring {
  transform: none;
  box-shadow: var(--qm-shadow-sm);
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .metric,
  .personal-metrics > article,
  .okr-card {
    transition: none;
  }
}

/* ============================================================
   QM175 — Lớp TĂNG TƯƠNG PHẢN.
   Sidebar tối kiểu "command center", nền có sắc để card trắng
   nổi bật, viền rõ hơn. Khắc phục "toàn màu trắng khó nhìn".
   ============================================================ */
:root {
  --qm-canvas: #e8ecea;        /* nền có sắc, để card trắng nổi */
  --qm-line: #d1d9d4;          /* viền card rõ hơn */
  --qm-line-soft: #e0e6e2;
  --qm-side: #0f241d;          /* sidebar xanh đậm */
  --qm-side-soft: #18352b;
  --qm-side-line: rgba(255, 255, 255, 0.09);
  --qm-side-text: #c4d4cd;
  --qm-side-muted: #7f968c;
}

/* ---- Sidebar tối ---- */
.sidebar {
  color: var(--qm-side-text);
  background: var(--qm-side);
  border-right: 1px solid #07140f;
  box-shadow: 4px 0 24px rgba(8, 20, 16, 0.18);
}

.brand strong {
  color: #ffffff;
}

.brand small {
  color: var(--qm-side-muted);
}

.cycle-card {
  background: var(--qm-side-soft);
  border-color: var(--qm-side-line);
  box-shadow: none;
}

.cycle-card span,
.cycle-card small {
  color: var(--qm-side-muted);
}

.cycle-card strong {
  color: #ffffff;
}

.cycle-select {
  width: 100%;
  margin-top: 2px;
  padding: 7px 9px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--qm-side-line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.cycle-select option {
  color: #15211c;
}

.nav-section-label {
  color: var(--qm-side-muted);
}

.nav-item {
  color: var(--qm-side-text);
}

.nav-item > span {
  color: var(--qm-side-muted);
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: #ffffff;
  background: var(--qm-green);
  font-weight: 720;
}

.nav-item.active::before {
  background: #8fe6d2;
}

.nav-item.active > span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.identity-card {
  border-top: 1px solid var(--qm-side-line);
}

.member-name strong {
  color: #ffffff;
}

.member-name span,
.identity-meta,
.status-card {
  color: var(--qm-side-muted);
}

.role-pill {
  color: #d7f3ea;
  background: rgba(143, 230, 210, 0.16);
}

.sidebar .text-button {
  color: var(--qm-side-text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--qm-side-line);
}

.sidebar .text-button:hover {
  color: #ffd9d6;
  background: rgba(187, 63, 70, 0.22);
  border-color: rgba(187, 63, 70, 0.5);
}

/* ---- Vùng nội dung: tăng độ rõ ---- */
.main-panel {
  background: var(--qm-canvas);
}

.workspace-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--qm-line);
  box-shadow: 0 1px 0 rgba(20, 40, 33, 0.03);
  backdrop-filter: saturate(1.1) blur(8px);
}

.panel,
.metric,
.personal-metrics > article {
  border-color: var(--qm-line);
  box-shadow: 0 1px 2px rgba(20, 40, 33, 0.06), 0 1px 0 rgba(20, 40, 33, 0.02);
}

/* Tiêu đề panel có nền nhẹ để tách khỏi thân */
.panel-heading {
  background: #f6f8f7;
}

/* Hàng/ô bảng có line rõ hơn */
.data-table th,
.db-head {
  background: #eef2f0;
}

/* ---- Màn "Công việc phát sinh" ---- */
.adhoc-list {
  display: grid;
  gap: 12px;
}

.adhoc-tasks {
  display: grid;
}

.adhoc-task {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--qm-line-soft);
  font-size: 13px;
}

.adhoc-task:first-child {
  border-top: 0;
}

.adhoc-task.is-done .adhoc-task-title {
  color: var(--qm-muted);
  text-decoration: line-through;
}

.adhoc-task.overdue .adhoc-task-meta:nth-of-type(2) {
  color: var(--qm-red);
  font-weight: 700;
}

.adhoc-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.adhoc-task-meta {
  color: var(--qm-muted);
  font-size: 11px;
  white-space: nowrap;
}

.task-state-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: #c2cdc7;
  border-radius: 50%;
}

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

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

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

/* ---- Timeline / việc sắp tới ---- */
.timeline-list {
  display: grid;
  gap: 18px;
}

.timeline-bucket {
  display: grid;
  gap: 8px;
}

.timeline-bucket-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 7px;
  border-bottom: 1px solid var(--qm-line);
}

.timeline-bucket-head strong {
  font-size: 13px;
  font-weight: 760;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--qm-muted);
}

.timeline-bucket.tone-red .timeline-dot { background: var(--qm-red); }
.timeline-bucket.tone-amber .timeline-dot { background: var(--qm-amber); }
.timeline-bucket.tone-blue .timeline-dot { background: var(--qm-blue); }
.timeline-bucket.tone-green .timeline-dot { background: var(--qm-green); }

.timeline-items {
  display: grid;
  gap: 7px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-radius: 9px;
  box-shadow: var(--qm-shadow-sm);
}

.timeline-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--qm-ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline-bucket.tone-red .timeline-date {
  color: var(--qm-red);
}

.timeline-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.timeline-main strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-main span {
  font-size: 11px;
  color: var(--qm-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-owner {
  font-size: 11px;
  color: var(--qm-ink-soft);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .timeline-item {
    grid-template-columns: 70px minmax(0, 1fr);
  }
  .timeline-owner,
  .timeline-item .status-pill {
    display: none;
  }
}

/* ---- To-do list trong Task ---- */
.todo-section {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--qm-line);
}

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

.todo-head h3 {
  margin: 0;
  font-size: 13px;
}

.todo-list {
  display: grid;
  gap: 5px;
  margin: 10px 0;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line-soft);
  border-radius: 8px;
}

.todo-check {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-size: 13px;
}

.todo-check input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  accent-color: var(--qm-green);
  cursor: pointer;
}

.todo-item.is-done .todo-check span {
  color: var(--qm-muted);
  text-decoration: line-through;
}

.todo-del {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  font-size: 16px;
  color: var(--qm-muted);
  border-color: var(--qm-line);
}

.todo-del:hover {
  color: var(--qm-red);
  border-color: #e6c4c7;
  background: var(--qm-red-soft);
}

.todo-add {
  display: flex;
  gap: 6px;
}

.todo-add input {
  flex: 1;
  min-height: 35px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 8px;
}

.todo-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--qm-muted);
}

/* ---- Trao đổi / bình luận theo Task ---- */
.comment-section {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--qm-line);
}

.comment-list {
  display: grid;
  gap: 10px;
  margin: 10px 0;
}

.comment-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
}

.comment-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  font-size: 10px;
}

.comment-body {
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.comment-meta strong {
  font-size: 12px;
  font-weight: 700;
}

.comment-meta span {
  font-size: 10px;
  color: var(--qm-muted);
}

.comment-body p {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-del {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  font-size: 15px;
  color: var(--qm-muted);
  border-color: var(--qm-line);
}

.comment-del:hover {
  color: var(--qm-red);
  border-color: #e6c4c7;
  background: var(--qm-red-soft);
}

.comment-add {
  display: grid;
  gap: 7px;
}

.comment-add textarea {
  width: 100%;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 8px;
  resize: vertical;
}

.comment-add .compact-button {
  justify-self: end;
}

/* ---- Badge mã O/K/T ---- */
.code-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 2px 7px;
  color: var(--qm-green-dark);
  background: var(--qm-green-soft);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.obj-code {
  font-size: 12px;
}

.kr-code {
  color: var(--qm-ink-soft);
  background: #eaeeec;
}

/* ---- Dashboard hiệu suất theo người ---- */
.dashboard-people {
  display: grid;
}

.people-dashboard {
  display: grid;
}

.people-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 54px 54px 170px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--qm-line-soft);
}

.people-row:first-child {
  border-top: 0;
}

.people-main {
  min-width: 0;
  display: grid;
}

.people-main strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-main span {
  font-size: 11px;
  color: var(--qm-muted);
}

.people-stat {
  text-align: center;
}

.people-stat strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.people-stat span {
  display: block;
  font-size: 9px;
  color: var(--qm-muted);
  text-transform: uppercase;
}

.people-prog {
  display: flex;
  align-items: center;
  gap: 8px;
}

.people-prog .progress-track {
  flex: 1;
}

.people-prog > span {
  min-width: 34px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 640px) {
  .people-row {
    grid-template-columns: 34px minmax(0, 1fr) 46px;
  }
  .people-stat:nth-of-type(4),
  .people-prog {
    display: none;
  }
}

/* ---- Điều khiển Timeline (gom kỳ + lọc) ---- */
.timeline-toolbar {
  flex-wrap: wrap;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-controls select {
  min-height: 33px;
  padding: 5px 28px 5px 10px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 8px;
}

.tl-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--qm-ink-soft);
  white-space: nowrap;
  cursor: pointer;
}

.tl-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--qm-green);
  cursor: pointer;
}

.timeline-summary-line {
  margin: -4px 0 2px;
}

.timeline-item.is-done .timeline-main strong {
  color: var(--qm-muted);
  text-decoration: line-through;
}

/* ---- Dòng công việc bấm được để mở trang sửa ---- */
.clickable-task {
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.clickable-task:hover {
  background: #f3f7f5;
  border-color: #b6d2c8;
}

.timeline-item.clickable-task:hover {
  box-shadow: var(--qm-shadow-md);
}

.my-task-row.clickable-task:hover,
.adhoc-task.clickable-task:hover {
  background: #f1f6f3;
}

/* ---- Biểu đồ trực quan (donut / gauge) ---- */
.dashboard-visuals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.viz-panel {
  display: flex;
  flex-direction: column;
}

.viz-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 20px;
}

.donut-svg {
  width: 144px;
  height: 144px;
}

.donut-num {
  font-size: 25px;
  font-weight: 800;
  fill: var(--qm-ink);
}

.donut-sub {
  font-size: 9px;
  font-weight: 700;
  fill: var(--qm-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
}

.viz-leg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--qm-ink-soft);
}

.viz-leg i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 3px;
}

.viz-leg b {
  font-variant-numeric: tabular-nums;
}

.viz-caption {
  margin: 0;
  font-size: 11px;
  color: var(--qm-muted);
  text-align: center;
}

@media (max-width: 900px) {
  .dashboard-visuals {
    grid-template-columns: 1fr;
  }
}

/* ---- Thẻ chỉ số bấm được ---- */
.clickable-metric {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.clickable-metric:hover {
  border-color: #b6d2c8;
  box-shadow: var(--qm-shadow-md);
  transform: translateY(-2px);
}

/* ---- Báo cáo tháng/quý ---- */
.report-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-controls select {
  min-height: 33px;
  padding: 5px 28px 5px 10px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 8px;
}

.report-doc {
  max-width: 940px;
  margin: 0 auto;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--qm-shadow-sm);
}

.report-cover {
  padding: 38px 40px 30px;
  color: #fff;
  background: linear-gradient(135deg, #0e1523 0%, #1a2744 60%, #0e1523 100%);
}

.report-badge {
  display: inline-flex;
  padding: 5px 12px;
  margin-bottom: 16px;
  color: #93c5fd;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.report-cover h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.report-cover-sub {
  margin: 0 0 24px;
  color: #94a3b8;
  font-size: 13px;
}

.report-cover-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.report-cover-meta > div {
  display: grid;
  gap: 3px;
}

.report-cover-meta span {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.report-cover-meta strong {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.report-section {
  padding: 24px 40px;
  border-top: 1px solid var(--qm-line-soft);
}

.report-sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--qm-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.report-sec-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--qm-line);
}

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

.report-kpi {
  display: grid;
  gap: 3px;
  padding: 16px 18px;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-left-width: 4px;
  border-radius: 10px;
}

.report-kpi strong {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.report-kpi span {
  font-size: 12px;
  color: var(--qm-ink-soft);
  font-weight: 600;
}

.report-kpi small {
  font-size: 11px;
  color: var(--qm-muted);
}

.report-kpi.green { border-left-color: var(--qm-green); }
.report-kpi.green strong { color: var(--qm-green); }
.report-kpi.amber { border-left-color: var(--qm-amber); }
.report-kpi.amber strong { color: var(--qm-amber); }
.report-kpi.red { border-left-color: var(--qm-red); }
.report-kpi.red strong { color: var(--qm-red); }
.report-kpi.blue { border-left-color: var(--qm-blue); }
.report-kpi.blue strong { color: var(--qm-blue); }

.report-objs {
  display: grid;
  gap: 14px;
}

.report-obj {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-radius: 10px;
}

.report-obj-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-obj-head strong {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.report-obj-head b {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.report-obj-stats {
  display: flex;
  gap: 14px;
  font-size: 11px;
  font-weight: 600;
}

.report-obj-stats .rp-y { color: var(--qm-green); }
.report-obj-stats .rp-d { color: var(--qm-amber); }
.report-obj-stats .rp-n { color: var(--qm-red); }
.report-obj-stats .rp-muted { color: var(--qm-muted); margin-left: auto; }

.report-foot {
  padding: 16px 40px 24px;
  color: var(--qm-muted);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 760px) {
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .report-cover, .report-section, .report-foot { padding-left: 22px; padding-right: 22px; }
}

/* ---- In / xuất PDF báo cáo ---- */
@media print {
  .sidebar,
  .workspace-header,
  .no-print {
    display: none !important;
  }
  .app-shell {
    display: block;
  }
  .page-canvas {
    max-width: none;
    padding: 0;
  }
  .report-doc {
    border: none;
    box-shadow: none;
    border-radius: 0;
  }
  body, html {
    background: #fff;
  }
}

/* ---- Đa người phụ trách (chính + phối hợp) ---- */
.assignee-collab {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.collab-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: #fff;
  border: 1px solid var(--qm-line);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.collab-chip:has(input:checked) {
  color: var(--qm-green-dark);
  background: var(--qm-green-soft);
  border-color: #8fcabb;
  font-weight: 600;
}

.collab-chip input {
  width: 14px;
  height: 14px;
  accent-color: var(--qm-green);
  cursor: pointer;
}

/* ---- Minh chứng / tài liệu task ---- */
.attach-section {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--qm-line);
}

.attach-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.attach-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--qm-line-soft);
  border-radius: 8px;
}

.attach-link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--qm-green-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.attach-link:hover {
  text-decoration: underline;
}

.attach-meta {
  font-size: 11px;
  color: var(--qm-muted);
  white-space: nowrap;
}

.attach-del {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  font-size: 15px;
  color: var(--qm-muted);
  border-color: var(--qm-line);
}

.comment-locked {
  font-size: 12px;
  font-style: italic;
}

/* ---- Báo cáo: phân tích chi tiết từng Objective ---- */
.report-obj-card {
  margin-bottom: 16px;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-radius: 12px;
  overflow: hidden;
}

.report-obj-header {
  display: flex;
  gap: 14px;
  padding: 18px 20px 14px;
}

.report-obj-badge {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.report-obj-badge.tone-green { background: var(--qm-green); }
.report-obj-badge.tone-amber { background: var(--qm-amber); }
.report-obj-badge.tone-red { background: var(--qm-red); }

.report-obj-info { min-width: 0; }

.report-obj-info h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 760;
}

.report-obj-info p {
  margin: 0 0 8px;
  color: var(--qm-muted);
  font-size: 12px;
}

.report-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-stat-pills .sp {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.report-stat-pills .sp.green { color: #065f46; background: #d1fae5; }
.report-stat-pills .sp.amber { color: #92400e; background: #fde68a; }
.report-stat-pills .sp.red { color: #991b1b; background: #fecaca; }

.report-forecast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--qm-line-soft);
  border-bottom: 1px solid var(--qm-line-soft);
}

.report-forecast.tone-green { background: #ecfdf5; }
.report-forecast.tone-amber { background: #fffbeb; }
.report-forecast.tone-red { background: #fef2f2; }

.rf-icon { font-size: 16px; }

.rf-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rf-text strong { font-size: 13px; }
.report-forecast.tone-green .rf-text strong { color: #065f46; }
.report-forecast.tone-amber .rf-text strong { color: #92400e; }
.report-forecast.tone-red .rf-text strong { color: #991b1b; }
.rf-text span { font-size: 12px; color: var(--qm-ink-soft); line-height: 1.55; }

.rf-badge {
  flex: 0 0 auto;
  align-self: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}

.report-forecast.tone-green .rf-badge { background: var(--qm-green); }
.report-forecast.tone-amber .rf-badge { background: var(--qm-amber); }
.report-forecast.tone-red .rf-badge { background: var(--qm-red); }

.report-obj-body {
  padding: 14px 20px 18px;
  display: grid;
  gap: 14px;
}

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

.report-key-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-key-head strong {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.report-key-head b {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--qm-ink-soft);
}

.report-task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.report-task-table th {
  padding: 7px 10px;
  text-align: left;
  color: var(--qm-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f1f5f3;
  border-bottom: 1px solid var(--qm-line);
}

.report-task-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--qm-line-soft);
  vertical-align: top;
}

.report-task-table td:first-child { font-weight: 600; }

.status-badge {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.sb-done { color: #065f46; background: #d1fae5; }
.status-badge.sb-doing { color: #92400e; background: #fde68a; }
.status-badge.sb-blocked { color: #991b1b; background: #fecaca; }
.status-badge.sb-todo { color: var(--qm-ink-soft); background: #e8edea; }

.status-badge.sb-key-done { color: #065f46; background: #d1fae5; }
.status-badge.sb-key-active { color: #1e40af; background: #dbeafe; }
.status-badge.sb-key-at_risk { color: #991b1b; background: #fecaca; }
.status-badge.sb-key-draft { color: var(--qm-ink-soft); background: #e8edea; }
.status-badge.sb-key-archived { color: var(--qm-muted); background: #eef1ef; }

/* ---- Badge người thực hiện (highlight + nhãn PT) ---- */
.person-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 9px 2px 3px;
  color: #1e3a8a;
  background: #eaf0fd;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  vertical-align: middle;
}

.person-badge .pb-ic {
  display: inline-grid;
  place-items: center;
  height: 16px;
  padding: 0 5px;
  color: #fff;
  background: var(--qm-blue);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.person-badge .pb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-badge .pb-extra {
  color: var(--qm-blue);
  font-weight: 700;
}

/* ---- Nút Xoá + nhãn người sửa cuối ---- */
.danger-button {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #f3b4b4;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease;
}

.danger-button:hover {
  background: #fee2e2;
  border-color: #e58a8a;
}

.last-editor {
  font-size: 11px;
  font-weight: 600;
  color: var(--qm-muted);
}

/* ---- Lưới phân công RACI ---- */
.raci-box {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

.raci-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.raci-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raci-opts {
  display: flex;
  gap: 3px;
}

.raci-opt {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  color: var(--qm-muted);
  border: 1px solid var(--qm-line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.raci-opt input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.raci-opt.on.raci-R { color: #fff; background: var(--qm-green); border-color: var(--qm-green); }
.raci-opt.on.raci-A { color: #fff; background: var(--qm-red); border-color: var(--qm-red); }
.raci-opt.on.raci-C { color: #fff; background: var(--qm-blue); border-color: var(--qm-blue); }
.raci-opt.on.raci-I { color: #fff; background: var(--qm-amber); border-color: var(--qm-amber); }
.raci-opt.on.raci-none { color: var(--qm-ink); background: #e8edea; }

/* ---- Công cụ sinh công việc theo kỳ ---- */
.recur-section {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--qm-line);
}

.recur-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
}

.recur-grid input,
.recur-grid select {
  min-height: 34px;
  padding: 6px 9px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 8px;
}

.recur-grid input#recurYear {
  width: 84px;
}

@media (max-width: 560px) {
  .recur-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .report-obj-card { break-inside: avoid; }
}

/* ---- Danh sách Task/Key trong drawer: rõ hơn, có % + badge màu ---- */
.drawer-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-radius: 9px;
}

.drawer-list-item .dli-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.drawer-list-item .dli-main strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-list-item .dli-meta {
  color: var(--qm-ink-soft);
  font-size: 11.5px;
}

.drawer-list-item .dli-pct {
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--qm-ink);
}

/* ---- Nút cầu cứu + bình luận help ---- */
.help-request-btn {
  width: 100%;
  margin: 4px 0 10px;
  padding: 9px 12px;
  color: #92400e;
  background: #fff7ed;
  border: 1px dashed #f6b16b;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 130ms ease;
}

.help-request-btn:hover {
  background: #ffedd5;
}

.comment-item.comment-help {
  padding: 8px 10px;
  background: #fff7ed;
  border: 1px solid #f6b16b;
  border-radius: 9px;
}

.comment-item.comment-help .comment-body p {
  color: #9a3412;
  font-weight: 600;
}

/* ---- Chuông thông báo ---- */
.notif-wrap {
  position: relative;
}

.notif-btn {
  position: relative;
  min-width: 40px;
  padding-left: 9px;
  padding-right: 9px;
}

.notif-btn.has-notif {
  border-color: #f0b27a;
  background: #fff7ed;
}

.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  color: #fff;
  background: var(--qm-red);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 340px;
  max-width: 86vw;
  max-height: 460px;
  overflow: auto;
  background: var(--qm-surface);
  border: 1px solid var(--qm-line);
  border-radius: 12px;
  box-shadow: var(--qm-shadow-md);
}

.notif-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--qm-line-soft);
}

.notif-head strong { font-size: 13px; }
.notif-head span { font-size: 11px; color: var(--qm-muted); }

.notif-list { display: grid; }

.notif-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--qm-line-soft);
  text-align: left;
  cursor: pointer;
}

.notif-item:hover { background: #f3f7f5; }

.notif-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.notif-dot.tone-red { background: var(--qm-red); }
.notif-dot.tone-amber { background: var(--qm-amber); }

.notif-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.notif-main strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-main span { font-size: 11px; color: var(--qm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notif-when { font-size: 11px; font-weight: 700; white-space: nowrap; }
.notif-when.tone-red { color: var(--qm-red); }
.notif-when.tone-amber { color: var(--qm-amber); }

.notif-empty { padding: 16px 14px; font-size: 12px; color: var(--qm-muted); }

/* ---- Lịch sử chỉnh sửa ---- */
.activity-log-list {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 2px;
}

.activity-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 6px;
  background: var(--qm-green);
  border-radius: 50%;
}

.activity-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
  font-size: 12.5px;
  line-height: 1.45;
}

.activity-time {
  font-size: 11px;
  color: var(--qm-muted);
}

/* ---- Thêm việc/nhóm phát sinh ---- */
.adhoc-newgroup,
.adhoc-addtask {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.adhoc-addtask {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--qm-line-soft);
}

.adhoc-newgroup {
  padding: 12px 14px;
  margin-bottom: 4px;
  background: var(--qm-surface);
  border: 1px dashed var(--qm-line-strong, #cbd5d0);
  border-radius: 10px;
}

.adhoc-newgroup input,
.adhoc-addtask input[name="title"] {
  flex: 1;
  min-width: 160px;
  min-height: 34px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 8px;
}

.adhoc-addtask input[type="date"] {
  min-height: 34px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 8px;
}

/* ---- Đánh giá chất lượng trong nhận xét ---- */
.comment-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-add-row select {
  flex: 1;
  min-height: 34px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #d5dcd8;
  border-radius: 8px;
}

.quality-badge {
  display: inline-flex;
  width: fit-content;
  margin: 3px 0;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.quality-badge.rate-excellent { color: #065f46; background: #d1fae5; }
.quality-badge.rate-good { color: #075985; background: #e0f2fe; }
.quality-badge.rate-fair { color: #92400e; background: #fde68a; }
.quality-badge.rate-poor { color: #991b1b; background: #fecaca; }

/* ---- 2026 operating-console polish ---- */
:root {
  --qm-radius-card: 8px;
  --qm-radius-control: 7px;
  --qm-shadow-soft: 0 16px 42px rgba(15, 23, 42, 0.1);
  --qm-shadow-lift: 0 18px 34px rgba(9, 30, 66, 0.14), 0 2px 0 rgba(255, 255, 255, 0.7) inset;
  --qm-surface-glass: rgba(255, 255, 255, 0.88);
  --qm-accent-green: #0f766e;
  --qm-accent-blue: #2563eb;
  --qm-accent-amber: #d97706;
  --qm-accent-violet: #6d5dfc;
}

body {
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    #eef2f4;
  background-size: 42px 42px, 42px 42px, auto;
}

.login-screen {
  background:
    linear-gradient(135deg, rgba(11, 31, 47, 0.97), rgba(20, 54, 45, 0.94) 52%, rgba(41, 37, 76, 0.92)),
    #10251f;
}

.login-shell {
  width: min(1080px, calc(100vw - 48px));
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  perspective: 1200px;
}

.login-context,
.login-form,
.panel,
.metric,
.personal-metrics article,
.okr-card,
.kr-card,
.member-row,
.database-panel,
.detail-drawer {
  border-radius: var(--qm-radius-card);
  box-shadow: var(--qm-shadow-soft);
}

.login-form {
  transform: translateZ(24px);
  min-width: 0;
  margin: 26px 28px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.visual-card {
  border-radius: 8px;
  transform-style: preserve-3d;
  box-shadow: 0 22px 48px rgba(2, 8, 23, 0.28);
}

.visual-card-back { transform: rotateX(8deg) rotateY(-12deg) translate3d(-24px, 0, -26px); }
.visual-card-middle { transform: rotateX(5deg) rotateY(-7deg) translate3d(14px, 14px, 12px); }
.visual-card-front { transform: rotateX(2deg) rotateY(8deg) translate3d(58px, 32px, 44px); }

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 40px rgba(2, 8, 23, 0.18);
}

.brand-mark {
  box-shadow: 0 10px 22px rgba(20, 184, 166, 0.22);
}

.nav-item {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-item:hover {
  transform: translateX(2px);
  border-color: rgba(148, 163, 184, 0.22);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.18), rgba(37, 99, 235, 0.12));
  border-color: rgba(94, 234, 212, 0.36);
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 8;
  backdrop-filter: blur(18px);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(248, 250, 252, 0.78));
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.workspace-heading h1 {
  letter-spacing: 0;
}

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

.primary-button,
.secondary-button,
.text-button,
.icon-button,
.view-tab,
.scope-tab {
  border-radius: var(--qm-radius-control);
}

.primary-button {
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.22);
}

.metrics-grid,
.dashboard-visuals,
.dashboard-primary-grid,
.dashboard-secondary-grid,
.personal-work-layout,
.checkin-layout,
.analysis-layout,
.team-layout {
  gap: 16px;
}

.metric {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.78);
  background: var(--qm-surface-glass);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--qm-accent-green);
}

.metric:nth-child(2)::before { background: var(--qm-accent-blue); }
.metric:nth-child(3)::before { background: var(--qm-accent-amber); }
.metric:nth-child(4)::before { background: var(--qm-accent-violet); }

.panel,
.okr-card,
.kr-card,
.member-row,
.database-panel {
  border: 1px solid rgba(203, 213, 225, 0.86);
  background: var(--qm-surface-glass);
}

.panel:hover,
.okr-card:hover,
.kr-card:hover {
  box-shadow: var(--qm-shadow-lift);
}

.data-commandbar,
.context-toolbar,
.database-heading,
.okr-page-heading {
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.chart-board,
.viz-body,
.risk-list,
.team-progress,
.database-table-host,
.member-table,
.my-work-list,
.timeline-list,
.activity-timeline {
  border-radius: 8px;
}

.person-badge,
.role-pill,
.hint-pill,
.live-badge,
.source-badge,
.database-state,
.data-freshness {
  border-radius: 999px;
}

.status-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.status-card:has(.status-dot.ok) {
  background: rgba(13, 148, 136, 0.11);
}

.detail-drawer {
  border-left: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(18px);
}

.drawer-header {
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
}

input,
select,
textarea {
  border-radius: var(--qm-radius-control);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.analysis-layout .panel.wide {
  min-height: 420px;
}

#analysisOutput {
  min-height: 300px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  .workspace-header {
    position: relative;
  }

  .login-form,
  .visual-card-back,
  .visual-card-middle,
  .visual-card-front {
    transform: none;
  }
}
