:root {
  --sidebar-width: 214px;
  --workspace-topbar-height: 50px;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --ink: #1f2328;
  --muted: #68707c;
  --line: #d7dbe0;
  --accent: #123d73;
  --accent-strong: #001e46;
  --nav-active: #123d73;
  --red: #ce1b22;
  --red-bg: #fdf0f0;
  --yellow: #af7600;
  --yellow-bg: #fff8e8;
  --green: #16833f;
  --green-bg: #edf8f0;
  --blue-bg: #eef4fb;
  --blue: #2563b8;
  --shadow: none;
  --radius: 0;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.5;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background: var(--bg);
}

.auth-panel {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  padding: 32px;
  background: var(--surface);
}

.auth-logo {
  display: block;
  width: min(100%, 240px);
  height: auto;
  margin: 0 0 26px;
}

.auth-panel h1 {
  margin-bottom: 8px;
  font-size: 24px;
}

.auth-panel > p:not(.section-label) {
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.auth-form .button {
  width: 100%;
  min-height: 44px;
}

.auth-form .button.ghost {
  border-color: transparent;
  color: var(--accent);
}

.auth-message {
  margin-top: 18px;
}

.auth-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-context .section-label {
  margin: 0;
}

.environment-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid #54749a;
  padding: 2px 8px;
  background: #eef4fb;
  color: #123d73;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pilot-notice {
  display: grid;
  gap: 2px;
  margin-top: 16px;
  border: 1px solid #8ba2bd;
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  background: #f4f7fb;
  color: var(--ink);
  font-size: 13px;
}

.pilot-notice span {
  color: var(--muted);
  line-height: 1.45;
}

.view-pilot-notice {
  margin: 0 0 12px;
}

.check-field {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  padding: 9px 11px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.check-field input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.conflict-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.conflict-alert > div {
  display: grid;
  gap: 3px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid #2563b8;
  outline-offset: 2px;
}

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

.product-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  display: flex;
  height: var(--workspace-topbar-height);
  align-items: center;
  border-bottom: 1px solid #e5e8ed;
  background: #ffffff;
  color: #202428;
}

.product-home {
  display: inline-flex;
  width: var(--sidebar-width);
  height: 100%;
  align-items: center;
  border-right: 1px solid #e5e8ed;
  padding: 0 16px;
  color: #263b55;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.product-tabs {
  display: flex;
  height: 100%;
  align-items: center;
}

.product-tab,
.product-tab-context {
  display: inline-flex;
  height: 100%;
  align-items: center;
  border-right: 1px solid #eef0f3;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.product-tab.is-active {
  color: var(--accent-dark, #001e46);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.product-tab-context {
  color: var(--muted);
  font-weight: 700;
}

.product-year {
  margin-left: auto;
  padding: 0 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-nav > .environment-badge {
  margin-left: 12px;
}

.app-shell {
  display: block;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: fixed;
  top: var(--workspace-topbar-height);
  left: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: calc(100vh - var(--workspace-topbar-height));
  overflow-y: auto;
  padding: 0 0 16px;
  border-right: 1px solid #dddddd;
  background: #f5f7fb;
  color: var(--ink);
}

.brand {
  display: grid;
  gap: 5px;
  align-items: center;
  justify-items: center;
  min-height: 84px;
  padding: 11px 15px 9px;
  border-bottom: 1px solid #e5e8ed;
  background: #ffffff;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 170px;
  height: auto;
  max-height: 46px;
  object-fit: contain;
  object-position: center;
}

.brand span {
  display: block;
  width: 100%;
  border-top: 0;
  padding-top: 0;
  color: #202428;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.nav-list {
  display: grid;
  gap: 0;
  padding: 0;
  border-top: 0;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #dedede;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 0 14px;
  background: #f5f7fb;
  color: #333333;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.nav-button:hover {
  background: #edf2f7;
}

.nav-button[aria-current="page"] {
  border-left-color: var(--accent);
  background: var(--nav-active);
  color: #ffffff;
}

.sidebar-note {
  margin: auto 14px 0;
  border-top: 1px solid #dedede;
  padding-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.main-panel {
  min-width: 0;
  margin-left: var(--sidebar-width);
  height: calc(100vh - var(--workspace-topbar-height));
  margin-top: var(--workspace-topbar-height);
  overflow-y: auto;
  background: #ffffff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  border-bottom: 1px solid #e5e8ed;
  padding: 14px 24px;
  background: #ffffff;
}

.section-label {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.topbar h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.15;
  word-break: keep-all;
}

.topbar p:not(.section-label) {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.save-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.view {
  padding: 16px 24px 40px;
  background: #f5f7fb;
}

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

.kpis {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-bottom: 12px;
}

.main-grid {
  grid-template-columns: minmax(0, 1.28fr) minmax(380px, 0.72fr);
  align-items: start;
  margin-top: 12px;
}

.one-column {
  grid-template-columns: 1fr;
}

.card,
.kpi,
.rule-item,
.check-group,
.alert,
.stage-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.card {
  min-width: 0;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e8ed;
  padding: 13px 16px 11px;
  background: #ffffff;
}

.card-header h3 {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.2;
}

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

.card-body {
  padding: 15px 16px;
}

.kpi {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 102px;
  border-left: 3px solid var(--line);
  padding: 14px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: normal;
  word-break: keep-all;
}

.kpi small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi:nth-child(1) {
  border-left-color: var(--accent);
}

.kpi:nth-child(2) {
  border-left-color: #8199ac;
}

.kpi:nth-child(3) {
  border-left-color: #9aa8b6;
}

.kpi:nth-child(4) {
  border-left-color: #b8c0ca;
}

.select,
.field input {
  min-height: 34px;
  border: 1px solid #c7cdd5;
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

.select.full {
  width: 100%;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 74px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0 11px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  word-break: keep-all;
}

.button:hover {
  background: var(--accent-strong);
}

.button.secondary {
  border-color: var(--line);
  background: #f5f7fa;
  color: var(--ink);
}

.button.ghost {
  border-color: #c9b9b7;
  background: #ffffff;
  color: var(--red);
}

.button.danger {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

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

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

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

.form-grid.compact {
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 0.8fr) minmax(120px, 0.7fr);
}

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

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

.mcp-all-scope {
  width: fit-content;
}

.mcp-scope-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 10px;
}

.mcp-scope-list .inline-check {
  min-width: 0;
}

.mcp-endpoint,
.mcp-token-value,
.mcp-command code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.mcp-token-value {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 11px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}

.mcp-command {
  display: grid;
  gap: 4px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
}

.mcp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mcp-actions .button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.mcp-draft-summary {
  display: block;
  max-width: 280px;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
  white-space: normal;
}

.full-row {
  grid-column: 1 / -1;
}

.monthly-target-editor {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  background: #fbfcfd;
}

.monthly-target-editor > b {
  font-size: 14px;
}

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

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input {
  width: 100%;
}

.field.check-field input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.field.check-field span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.loading-shell {
  min-height: 100vh;
  background: #ffffff;
}

.loading-panel {
  margin-left: 0;
}

.rule-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.rule-box.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.rule-item {
  min-width: 0;
  padding: 12px;
}

.rule-item b,
.rule-item span {
  display: block;
}

.rule-item b {
  color: var(--ink);
  font-size: 14px;
}

.rule-item span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.workforce-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

.staff-table td small,
.staff-table td b {
  display: block;
}

.staff-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.workforce-editor {
  position: sticky;
  top: 92px;
}

.staff-assignment-form {
  gap: 14px;
}

.password-reset-panel {
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.password-reset-panel summary {
  cursor: pointer;
  padding: 11px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.password-reset-panel > :not(summary) {
  margin: 0 12px 12px;
}

.dialog-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 30, 42, 0.42);
}

.account-security-dialog {
  width: min(100%, 480px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(20, 37, 57, 0.22);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e5e8ed;
  padding: 16px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 18px;
}

.account-security-form {
  gap: 13px;
  padding: 16px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

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

table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #e5e8ed;
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

td {
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: normal;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.selected-row td {
  background: #f0f4f8;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.ok {
  background: var(--green-bg);
  color: var(--green);
}

.status.warn {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.status.bad {
  background: var(--red-bg);
  color: var(--red);
}

.ok-text {
  color: var(--green);
}

.warn-text {
  color: var(--yellow);
}

.bad-text {
  color: var(--red);
}

.checklist {
  display: grid;
  gap: 10px;
}

.check-group {
  overflow: hidden;
}

.check-group summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid #e5e8ed;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.check-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 11px 12px 12px;
  list-style: none;
}

.check-list.standalone {
  border: 1px solid var(--line);
}

.check-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.check-list input {
  margin-top: 3px;
}

.compact-list {
  border: 1px solid var(--line);
  margin-top: 9px;
  padding: 10px 12px;
}

.alerts {
  display: grid;
  gap: 10px;
}

.alert {
  border-left: 3px solid var(--line);
  padding: 11px 12px;
}

.alert.ok {
  border-left-color: #8da8bb;
  background: var(--green-bg);
}

.alert.warn {
  border-left-color: #c4b680;
  background: var(--yellow-bg);
}

.alert.bad {
  border-left-color: #c9a19d;
  background: var(--red-bg);
}

.alert b {
  display: block;
  margin-bottom: 5px;
}

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

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

.stage-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  border-left: 5px solid var(--line);
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
}

.stage-row.current {
  border-left-color: var(--accent);
  background: #f0f4f8;
}

.stage-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stage-row b {
  font-size: 14px;
}

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

.company-summary {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  padding: 12px;
}

.company-summary b,
.company-summary small {
  display: block;
}

.company-summary small,
.footer-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.operating-alert,
.block-control,
.support-list {
  margin-top: 14px;
}

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

.support-item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  padding: 13px;
  background: #ffffff;
}

.participant-doc-group + .participant-doc-group {
  border-top: 1px solid var(--line);
}

.participant-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px 0;
  color: var(--ink);
  font-size: 13px;
}

.participant-doc-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.support-head b,
.support-head span,
.doc-progress {
  display: block;
}

.support-head span,
.doc-progress {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.doc-progress {
  margin-top: 8px;
  font-weight: 800;
}

.support-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.support-update-grid {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.support-link-grid {
  margin-top: 12px;
}

.inline-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.inline-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.compact-table {
  min-width: 560px;
}

.print-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.backup-manager {
  margin-bottom: 14px;
}

.excel-import-card {
  margin-bottom: 14px;
}

.import-controls {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px);
  gap: 12px;
  max-width: 540px;
  margin-bottom: 12px;
}

.import-controls .field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.excel-drop-zone {
  display: grid;
  gap: 7px;
  place-items: center;
  min-height: 132px;
  border: 2px dashed #aeb8c4;
  background: #f8fafc;
  padding: 22px;
  text-align: center;
  cursor: pointer;
}

.excel-drop-zone.drag-over {
  border-color: var(--accent);
  background: #edf3f7;
}

.excel-drop-zone input {
  display: none;
}

.excel-drop-zone b,
.excel-drop-zone span {
  display: block;
}

.excel-drop-zone b {
  font-size: 15px;
}

.excel-drop-zone span,
.import-result {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.import-result {
  margin-top: 10px;
  border-left: 5px solid var(--line);
  padding: 10px 12px;
  background: #f8f8f8;
}

.import-result.is-visible {
  border-left-color: var(--accent);
  background: var(--green-bg);
  color: var(--accent);
  font-weight: 800;
}

.import-preview {
  display: grid;
  gap: 11px;
  margin-top: 12px;
  border: 1px solid var(--line);
  padding: 14px;
  background: #ffffff;
}

.import-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.import-preview-header b,
.import-preview-header span {
  display: block;
}

.import-preview-header span:not(.status) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.import-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.import-preview-stats span {
  border: 1px solid var(--line);
  padding: 6px 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
}

.import-preview-stats b {
  color: var(--ink);
}

.backup-actions {
  margin-top: 0;
}

.backup-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  padding: 12px;
  background: #ffffff;
}

.backup-item b,
.backup-item span {
  display: block;
}

.backup-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.briefing-print {
  width: 100%;
  max-width: 210mm;
  margin: 0 auto;
  padding: 0;
}

.briefing-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid var(--ink);
  padding: 22px 24px 18px;
}

.briefing-title h2 {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.2;
}

.briefing-title p:not(.section-label) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.briefing-stamp {
  display: grid;
  place-items: center;
  min-width: 112px;
  min-height: 74px;
  border: 1px solid var(--line);
  text-align: center;
}

.briefing-stamp span,
.briefing-stamp b {
  display: block;
}

.briefing-stamp span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.briefing-stamp b {
  font-size: 14px;
}

.briefing-section {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.briefing-section h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

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

.briefing-metrics div,
.briefing-step,
.briefing-doc-line,
.briefing-sign div {
  border: 1px solid var(--line);
  background: #ffffff;
}

.briefing-metrics div {
  min-height: 82px;
  padding: 13px;
}

.briefing-metrics b,
.briefing-metrics span {
  display: block;
}

.briefing-metrics b {
  font-size: 18px;
  line-height: 1.15;
}

.briefing-metrics span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.briefing-step {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 12px;
}

.briefing-step span {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  background: #f7f7f7;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
}

.briefing-step b {
  font-size: 13px;
}

.briefing-step em,
.briefing-step small {
  display: block;
  font-style: normal;
  font-size: 12px;
}

.briefing-step small {
  color: var(--muted);
  line-height: 1.35;
}

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

.briefing-alerts {
  display: grid;
  gap: 8px;
}

.briefing-doc-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.briefing-table {
  min-width: 0;
  font-size: 12px;
}

.briefing-table th,
.briefing-table td {
  padding: 8px 7px;
}

.briefing-table tbody th {
  width: 160px;
}

.briefing-sign {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 10px;
  padding: 18px 24px 22px;
}

.briefing-sign div {
  min-height: 58px;
  padding: 8px 10px;
}

.briefing-sign span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.flow-rail.compact-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.flow-step {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  padding: 12px;
  background: #ffffff;
}

.flow-step span,
.flow-step b,
.flow-step small {
  display: block;
}

.flow-step span {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background: #f7f7f7;
  color: var(--ink);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 24px;
}

.flow-step b {
  margin-top: 8px;
  font-size: 13px;
}

.flow-step small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.summary-row td {
  border-top: 2px solid var(--ink);
  background: #f8f8f8;
}

.month-performance {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.month-row {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1fr) minmax(210px, 1.2fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 9px 10px;
}

.month-row b {
  font-size: 13px;
}

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

.month-bars {
  position: relative;
  height: 16px;
  border: 1px solid #cfcfcf;
  background: #f4f4f4;
}

.target-progress,
.actual-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.target-progress::-webkit-progress-bar {
  background: #f4f4f4;
}

.target-progress::-webkit-progress-value {
  background: #e2e2e2;
}

.actual-progress::-webkit-progress-bar {
  background: transparent;
}

.actual-progress::-webkit-progress-value {
  background: var(--accent);
}

.briefing-page {
  margin-top: 16px;
}

/* The fixed sidebar leaves less usable header width than the viewport suggests. */
@media (max-width: 1400px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

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

  .briefing-workflow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1320px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

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

  .workforce-editor {
    position: static;
  }
}

@media (max-width: 960px) {
  body {
    overflow: auto;
  }

  .product-nav {
    position: static;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    padding: 10px 14px;
  }

  .brand {
    justify-items: start;
  }

  .brand-logo {
    width: min(100%, 260px);
    max-height: 88px;
  }

  .nav-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-button {
    min-width: max-content;
  }

  .sidebar-note {
    display: none;
  }

  .main-panel {
    margin-left: 0;
    margin-top: 0;
    height: auto;
    overflow: visible;
  }

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

  .main-grid,
  .workforce-grid,
  .rule-box.four,
  .briefing-metrics,
  .briefing-workflow,
  .two-column-print,
  .flow-rail,
  .flow-rail.compact-flow {
    grid-template-columns: 1fr;
  }

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

  .assignment-check-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .product-nav {
    position: static;
    min-width: 320px;
    overflow-x: auto;
  }

  .product-home {
    width: auto;
    padding: 0 14px;
  }

  .product-tab,
  .product-tab-context {
    padding: 0 14px;
  }

  .product-year {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    padding: 18px;
  }

  .topbar-meta {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar-meta .save-note {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .topbar-meta .save-note:nth-child(2) {
    text-align: right;
  }

  .topbar-meta .select,
  .topbar-meta .button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
  }

  .field input,
  .select {
    min-height: 40px;
  }

  .view {
    padding: 14px;
  }

  .kpis,
  .form-grid,
  .form-grid.two,
  .form-grid.compact,
  .form-grid.expense-form,
  .rule-box,
  .rule-box.three,
  .rule-box.four,
  .briefing-metrics,
  .briefing-workflow,
  .two-column-print,
  .monthly-target-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar h1 {
    font-size: 24px;
    line-height: 1.24;
  }

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

  .briefing-title {
    flex-direction: column;
  }

  .briefing-stamp {
    width: 100%;
  }

  .briefing-sign {
    grid-template-columns: 1fr;
  }

  .backup-item {
    align-items: stretch;
    flex-direction: column;
  }

  .import-controls {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .mcp-all-scope {
    width: 100%;
  }

  .mcp-scope-list {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  * {
    box-shadow: none !important;
  }

  body {
    overflow: visible;
    background: #ffffff;
    color: #111111;
  }

  .product-nav,
  .sidebar,
  .topbar,
  .kpis,
  .print-actions,
  .excel-import-card,
  .backup-manager,
  .dialog-backdrop {
    display: none !important;
  }

  .app-shell,
  .main-panel {
    display: block;
    height: auto;
    min-height: 0;
    margin: 0;
    overflow: visible;
    background: #ffffff;
  }

  .view {
    padding: 0;
    background: #ffffff;
  }

  .briefing-page {
    margin: 0 !important;
  }

  .briefing-page,
  .briefing-print {
    width: 186mm;
    max-width: 186mm;
  }

  .card,
  .briefing-print {
    border: 0;
  }

  .briefing-title,
  .briefing-section,
  .briefing-sign {
    padding-left: 0;
    padding-right: 0;
  }

  .briefing-title {
    padding-top: 0;
    padding-bottom: 12px;
  }

  .briefing-title h2 {
    font-size: 22px;
  }

  .briefing-section {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .briefing-section h3 {
    margin-bottom: 7px;
  }

  .briefing-section,
  .briefing-metrics div,
  .briefing-step,
  .briefing-alerts .alert,
  .briefing-sign div {
    break-inside: avoid;
  }

  .briefing-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .briefing-metrics div {
    min-height: 64px;
    padding: 9px 10px;
  }

  .briefing-metrics b {
    font-size: 16px;
  }

  .briefing-metrics span {
    margin-top: 3px;
    font-size: 10.5px;
  }

  .briefing-workflow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .briefing-step {
    min-height: 78px;
    gap: 3px;
    padding: 8px;
  }

  .briefing-step b {
    font-size: 11px;
  }

  .briefing-step em,
  .briefing-step small {
    font-size: 10px;
    line-height: 1.25;
  }

  .two-column-print {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .briefing-alerts {
    gap: 5px;
  }

  .briefing-doc-line {
    padding: 6px 8px;
  }

  .briefing-alerts .alert {
    gap: 3px;
    padding: 7px 9px;
  }

  .briefing-table {
    width: 100%;
    table-layout: fixed;
    font-size: 10px;
  }

  .briefing-table thead th {
    width: auto;
  }

  .briefing-table tbody th {
    width: 30mm;
  }

  .briefing-table th,
  .briefing-table td {
    padding: 5px 4px;
    overflow-wrap: anywhere;
  }

  .briefing-sign {
    gap: 7px;
    padding-top: 8px;
    padding-bottom: 0;
  }

  .briefing-sign div {
    min-height: 42px;
    padding: 6px 8px;
  }

  .table-wrap {
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-panel {
    padding: 24px;
  }

  .conflict-alert {
    align-items: stretch;
    flex-direction: column;
  }
}
