:root {
  --bg: #f5f8fd;
  --surface: #f7faff;
  --surface-strong: #ffffff;
  --line: #dbe5f4;
  --text: #0f172a;
  --muted: #71809a;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #7c3aed;
  --danger: #dc2626;
  --success: #059669;
  --sidebar-line: #e7edf7;
  --shadow: 0 12px 36px rgba(37, 99, 235, 0.08);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 20%),
    linear-gradient(180deg, #fbfdff, #f5f8fd 44%);
}

body.app-booting .login-shell,
body.app-booting .app-shell {
  visibility: hidden;
}

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

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 16% 30%, rgba(255, 255, 255, 0.22) 0, rgba(255, 255, 255, 0.22) 6px, transparent 7px),
    radial-gradient(circle at 84% 68%, rgba(255, 255, 255, 0.22) 0, rgba(255, 255, 255, 0.22) 7px, transparent 8px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0.14) 1px, transparent 1px) 0 0 / 320px 320px,
    linear-gradient(135deg, #39a0ec 0%, #5568e8 100%);
}

.login-panel {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.92fr);
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-brand-panel,
.login-form,
.metric-card,
.panel,
.project-card,
.people-grid article,
.modal-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.login-brand-panel {
  min-height: 404px;
  padding: 36px 42px 42px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.1)),
    linear-gradient(135deg, #84c7ff 0%, #68aef5 45%, #5b8cf4 100%);
}

.login-brand-mark {
  width: min(310px, 100%);
  display: block;
  margin-top: 10px;
}

.login-brand-mark img {
  display: block;
  width: 100%;
  height: auto;
}

.login-brand-text {
  display: grid;
  gap: 6px;
  color: #ffffff;
  text-align: center;
  justify-items: center;
  margin-top: 18px;
}

.login-brand-text strong {
  font-size: 26px;
  font-weight: 700;
}

.login-brand-text span {
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.86);
  max-width: 320px;
}

.login-form {
  padding: 54px 46px 42px;
  display: grid;
  align-content: center;
  gap: 22px;
  background: #ffffff;
}

.login-form label,
.form-grid label {
  display: grid;
  gap: 8px;
}

.login-form span,
.form-grid span {
  font-size: 12px;
  color: var(--muted);
}

.form-grid span {
  font-size: 14px;
  font-weight: 600;
  color: #6b7a99;
}

input,
select,
textarea {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #ccd5ea;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
}

.prefixed-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
}

.prefixed-input-label {
  display: grid;
  place-items: center;
  min-width: 76px;
  padding: 0 14px;
  height: 42px;
  border: 1px solid #ccd5ea;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #f3f6fc;
  color: #8a97b2;
  font-size: 13px;
  font-weight: 600;
}

.prefixed-input input {
  border-radius: 0 8px 8px 0;
}

textarea {
  min-height: 78px;
  padding: 8px 12px;
  resize: vertical;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.required-mark {
  margin-left: 4px;
  color: #dc2626;
  font-style: normal;
  font-weight: 700;
}

.login-input-row {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  margin: 0;
}

.login-input-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 48px;
  border: 1px solid #ccd5ea;
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: #5d6578;
  background: #ffffff;
}

.login-input-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-input-row input {
  border-radius: 0 8px 8px 0;
}

.login-input-main {
  position: relative;
}

.login-password-row input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: #7b879d;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: #4f5f7f;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 12px;
  align-items: center;
}

.captcha-input {
  margin: 0;
}

.captcha-box {
  height: 40px;
  padding: 0;
  border: 1px solid #d7e0f0;
  border-radius: 8px;
  background: #f7faff;
  overflow: hidden;
  cursor: pointer;
}

.captcha-box img {
  display: block;
  width: 100%;
  height: 100%;
}

.remember-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: #a3adbd;
  font-size: 12px;
}

.remember-row input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.login-submit {
  height: 42px;
  border-radius: 21px;
  font-size: 15px;
  letter-spacing: 2px;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .login-panel {
    width: min(460px, 100%);
    grid-template-columns: 1fr;
  }

  .login-form {
    padding: 28px 22px 24px;
  }

  .login-brand-panel {
    min-height: 180px;
    padding: 28px 22px;
    gap: 14px;
  }

  .login-brand-mark {
    width: min(220px, 100%);
    margin-top: 0;
  }

  .login-brand-text strong {
    font-size: 22px;
  }

  .login-brand-text span {
    font-size: 13px;
  }
}

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

.app-shell.sidebar-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

.sidebar {
  background: #ffffff;
  color: var(--text);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-line);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid var(--sidebar-line);
  margin-bottom: 14px;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

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

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

.brand span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.sidebar-toggle {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 28px;
}

.sidebar-toggle:hover {
  background: #eff6ff;
  color: var(--primary);
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-group-label {
  padding: 14px 8px 8px;
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 1px;
}

.nav {
  display: grid;
  gap: 6px;
  width: 100%;
}

.nav-stack {
  display: grid;
  gap: 4px;
  width: 100%;
}

.nav-stack.is-collapsed .nav-subnav {
  display: none;
}

.nav-item {
  border: 0;
  color: #475569;
  background: transparent;
  text-align: left;
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.nav-toggle {
  justify-content: flex-start;
}

.nav-item:hover,
.nav-item.active {
  background: #eef4ff;
  color: var(--primary);
}

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

.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: #475569;
  flex: 0 0 20px;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  color: var(--primary);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item span:last-child {
  line-height: 1;
}

.nav-caret {
  margin-left: auto;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: #94a3b8;
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-caret svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-toggle:hover .nav-caret,
.nav-toggle.active .nav-caret {
  color: var(--primary);
}

.nav-stack.is-collapsed .nav-caret {
  transform: rotate(180deg);
}

.nav-subnav {
  display: grid;
  gap: 4px;
  padding-left: 28px;
  width: 100%;
}

.nav-subitem {
  border: 0;
  background: transparent;
  color: #64748b;
  text-align: left;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.nav-subitem:hover,
.nav-subitem.active {
  background: #f1f5ff;
  color: var(--primary);
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  min-height: 62px;
  padding: 6px 0 14px;
}

.app-shell.sidebar-collapsed .brand-main,
.app-shell.sidebar-collapsed .nav-group-label,
.app-shell.sidebar-collapsed .nav-item > :not(.nav-icon),
.app-shell.sidebar-collapsed .nav-subnav {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.app-shell.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.app-shell.sidebar-collapsed .nav {
  justify-items: center;
  gap: 10px;
}

.app-shell.sidebar-collapsed .nav-stack {
  justify-items: center;
  gap: 10px;
}

.app-shell.sidebar-collapsed .nav-item {
  width: 44px;
  height: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 0;
  margin: 0 auto;
  border-radius: 14px;
}

.app-shell.sidebar-collapsed .nav-toggle {
  justify-content: center;
}

.app-shell.sidebar-collapsed .nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.main {
  min-width: 0;
  min-height: 100vh;
  padding: 30px 30px 34px;
  background: #f8fbff;
  display: flex;
  flex-direction: column;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 16px;
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.breadcrumb-trail,
.breadcrumb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.breadcrumb-root {
  color: #94a3b8;
}

.breadcrumb-separator {
  color: #cbd5e1;
}

.breadcrumb-current {
  color: var(--text);
}

.welcome-text {
  color: #94a3b8;
}

.breadcrumb-user strong {
  color: var(--text);
  font-size: 14px;
}

.icon-button,
.primary-button,
.secondary-button,
.top-action-button {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  width: 38px;
  display: inline-grid;
  place-items: center;
}

.primary-button,
.secondary-button,
.top-action-button {
  padding: 0 16px;
}

.large {
  min-height: 46px;
}

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

.top-action-button {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  font-weight: 700;
}

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

.secondary-button:hover,
.top-action-button:hover,
.icon-button:hover {
  background: #eff6ff;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  stroke: #475569;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.main-footer {
  margin-top: auto;
  padding: 24px 0 6px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.8;
}

.main-footer p {
  margin: 0;
}

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

.metric-card {
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

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

.metric-card > span:first-child {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.metric-card strong {
  display: block;
  font-size: 22px;
  margin: 10px 0 0;
}

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

.metric-card-split .metric-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.metric-card-split .metric-pair strong {
  margin: 0 0 4px;
}

.metric-card-split .metric-pair small,
.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.overview-grid,
.dashboard-grid,
.finance-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-top: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-top: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 16px;
}

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

.settings-kv {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.settings-kv span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.settings-kv strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

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

.settings-form label {
  display: grid;
  gap: 6px;
}

.settings-form label span {
  font-size: 12px;
  color: var(--muted);
}

.settings-form input {
  height: 40px;
}

.settings-logo-preview {
  width: 132px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e2f2;
  border-radius: 10px;
  background: #f8fbff;
  overflow: hidden;
}

.settings-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.settings-inline-account {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
}

.settings-inline-account strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.settings-actions,
.settings-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.project-hub {
  display: grid;
  gap: 16px;
}

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

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

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

.chart-shell {
  min-height: 300px;
}

.chart-canvas {
  width: 100%;
  height: 300px;
}

.chart-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.mini-metric {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.mini-metric-split {
  grid-column: span 2;
}

.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.mini-metric-pair {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.mini-metric-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-metric-pair strong {
  margin: 0 0 4px;
}

.mini-metric-pair small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.project-toolbar {
  align-items: center;
}

.toolbar-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-scope-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -4px 0 16px;
}

.task-scope-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-scope-chip.active {
  border-color: rgba(37, 99, 235, 0.22);
  background: #eef4ff;
  color: var(--primary);
  font-weight: 600;
}

.finance-section-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.finance-section-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.finance-section-chip.active {
  border-color: rgba(37, 99, 235, 0.22);
  background: #eef4ff;
  color: var(--primary);
  font-weight: 600;
}

.search-input {
  width: 210px;
  background: #ffffff;
}

.filter-select {
  width: 112px;
  background: #ffffff;
  appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.project-filter-bar .search-input,
.project-filter-bar .filter-select {
  height: 38px;
}

.project-filter-bar .primary-button,
.project-filter-bar .secondary-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.checkbox-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

th.checkbox-col,
td.checkbox-col {
  padding-left: 10px;
  padding-right: 10px;
}

.checkbox-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
}

.panel {
  padding: 20px;
  box-shadow: var(--shadow);
}

.wide-panel {
  grid-column: 1 / -1;
}

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

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

.subpanel-head {
  margin-top: 18px;
}

.panel-divider {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.status-summary {
  display: grid;
  gap: 14px;
}

.status-row {
  display: grid;
  gap: 8px;
}

.status-row header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.status-bar {
  height: 11px;
  border-radius: 999px;
  background: #ebefea;
  overflow: hidden;
}

.status-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

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

.risk-list li {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.risk-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

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

.pulse-item {
  min-height: 116px;
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcf9, #f3f7f1);
  border: 1px solid var(--line);
  display: grid;
  align-content: space-between;
}

.pulse-item strong {
  font-size: 16px;
}

.pulse-item span {
  color: var(--muted);
  line-height: 1.6;
}

.tag {
  color: var(--primary);
  background: #eff6ff;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.tag.accent {
  color: var(--accent);
  background: #f3e8ff;
}

.tag.success {
  color: var(--success);
  background: #ecfdf5;
}

.tag.danger {
  color: var(--danger);
  background: #fef2f2;
}

.inline-status-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 26px 0 0;
  color: var(--primary);
}

.inline-status-wrap.accent {
  color: var(--accent);
}

.inline-status-wrap.success {
  color: var(--success);
}

.inline-status-wrap.danger {
  color: var(--danger);
}

.inline-status-wrap::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.inline-status-select {
  border: 0;
  min-width: 0;
  width: auto;
  max-width: 108px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-weight: 600;
  padding: 5px 0;
  padding-right: 0;
  background: transparent;
  line-height: 1.2;
  color: inherit;
}

.inline-status-select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  outline-offset: 1px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

tbody tr {
  cursor: pointer;
}

.is-selected-row {
  background: #eff6ff;
}

.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-subtext {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  cursor: pointer;
}

.attachment-link {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.link-button.danger {
  color: var(--danger);
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #f8fbff;
  position: sticky;
  top: 0;
}

.people-grid article {
  padding: 18px;
  box-shadow: var(--shadow);
}

.people-grid p {
  color: var(--muted);
  margin: 12px 0 0;
}

.load {
  height: 10px;
  border-radius: 999px;
  background: #e4ebed;
  margin-top: 18px;
  overflow: hidden;
}

.load span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d39d53, #a96b2f);
}

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

.money-list p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.money-list span {
  color: var(--muted);
}

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

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

.mini-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfdff;
  display: grid;
  gap: 6px;
}

.mini-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.mini-item small {
  color: var(--muted);
}

.info-stack {
  display: grid;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdff;
}

.info-row span {
  color: var(--muted);
}

.info-row strong {
  text-align: right;
}

.setting-collection {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.setting-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fcfdff;
}

.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.pagination-bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pagination-summary {
  color: var(--muted);
  font-size: 12px;
}

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

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fbfcf8;
  border-radius: 10px;
}

.task-item span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1200px) {
  .project-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(18, 33, 27, 0.4);
  backdrop-filter: blur(3px);
}

.confirm-dialog {
  width: min(460px, calc(100vw - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.confirm-dialog::backdrop {
  background: rgba(18, 33, 27, 0.4);
  backdrop-filter: blur(3px);
}

.confirm-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 24px 20px;
  box-shadow: 0 28px 60px rgba(18, 33, 27, 0.24);
}

.confirm-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.confirm-message {
  margin: 16px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.modal-card {
  width: min(600px, calc(100vw - 24px));
  padding: 16px;
  box-shadow: 0 28px 60px rgba(18, 33, 27, 0.24);
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

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

#entity-form[data-view="projects"] .form-grid,
#entity-form[data-view="edit-project"] .form-grid,
#entity-form[data-view="workforce"] .form-grid,
#entity-form[data-view="edit-employee"] .form-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

#entity-form[data-view="projects"] .form-grid > [data-field-key],
#entity-form[data-view="edit-project"] .form-grid > [data-field-key] {
  width: calc(50% - 5px);
}

#entity-form[data-view="workforce"] .form-grid > [data-field-key],
#entity-form[data-view="edit-employee"] .form-grid > [data-field-key] {
  width: calc(50% - 5px);
}

#entity-form[data-view="workforce"] .form-grid > [data-field-key="email"],
#entity-form[data-view="edit-employee"] .form-grid > [data-field-key="email"] {
  width: calc(40% - 7px);
}

#entity-form[data-view="projects"] .form-grid > [data-field-key="status"],
#entity-form[data-view="projects"] .form-grid > [data-field-key="startDate"],
#entity-form[data-view="projects"] .form-grid > [data-field-key="cycleDays"],
#entity-form[data-view="edit-project"] .form-grid > [data-field-key="status"],
#entity-form[data-view="edit-project"] .form-grid > [data-field-key="startDate"],
#entity-form[data-view="edit-project"] .form-grid > [data-field-key="cycleDays"] {
  width: calc(33.333% - 7px);
}

#entity-form[data-view="workforce"] .form-grid > [data-field-key="gender"],
#entity-form[data-view="edit-employee"] .form-grid > [data-field-key="gender"] {
  width: calc(20% - 7px);
}

#entity-form[data-view="workforce"] .form-grid > [data-field-key="gender"] select,
#entity-form[data-view="edit-employee"] .form-grid > [data-field-key="gender"] select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

#entity-form[data-view="workforce"] .form-grid > [data-field-key="occupation"],
#entity-form[data-view="edit-employee"] .form-grid > [data-field-key="occupation"] {
  width: calc(40% - 7px);
}

#entity-form[data-view="projects"] .form-grid > .full,
#entity-form[data-view="edit-project"] .form-grid > .full,
#entity-form[data-view="workforce"] .form-grid > .full,
#entity-form[data-view="edit-employee"] .form-grid > .full {
  width: 100%;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  height: 40px;
}

.form-grid textarea {
  min-height: 74px;
}

.form-grid label.full {
  grid-column: 1 / -1;
}

.form-grid .form-field-block {
  display: grid;
  gap: 6px;
}

.form-grid .form-field-block.full {
  grid-column: 1 / -1;
}

.form-grid .form-field-block > span {
  font-size: 14px;
  font-weight: 600;
  color: #6b7a99;
}

.multiselect-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #ccd5ea;
  border-radius: 10px;
  background: #ffffff;
  max-height: 148px;
  overflow-y: auto;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #e2e8f5;
  border-radius: 8px;
  background: #f8fbff;
}

.multiselect-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-height: 15px;
  padding: 0;
  flex: 0 0 auto;
}

.multiselect-option span {
  font-size: 13px;
  font-weight: 500;
  color: #42526b;
}

.multiselect-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.participant-editor {
  display: grid;
  gap: 10px;
}

#participant-editor-field {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
}

#participant-editor-field > span {
  white-space: nowrap;
}

.participant-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 220px) 96px 74px;
  gap: 8px;
  align-items: center;
}

.participant-search-input,
.participant-fee-draft {
  height: 38px !important;
}

.participant-search-input {
  width: 100%;
}

.participant-fee-draft {
  width: 100%;
}

.participant-editor-toolbar .primary-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.participant-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.participant-list {
  display: grid;
  gap: 8px;
}

.participant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d8e2f2;
  border-radius: 10px;
  background: #ffffff;
}

.participant-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.participant-meta-label {
  color: #6b7a99;
  font-size: 13px;
  flex: 0 0 auto;
}

.participant-name {
  font-size: 14px;
  font-weight: 600;
  color: #42526b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-fee-wrap {
  justify-content: flex-start;
}

.participant-fee-input {
  height: 36px !important;
  width: 120px;
}

.modal-error {
  margin: -4px 0 10px;
  color: #dc2626;
  font-size: 13px;
  line-height: 1.5;
}

.modal-actions {
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .app-shell,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .metrics-grid,
  .people-grid,
  .analytics-summary-grid,
  .analytics-grid,
  .overview-grid,
  .finance-layout,
  .board,
  .form-grid,
  .settings-grid,
  .settings-summary,
  .hero-strip,
  .pulse-grid {
    grid-template-columns: 1fr;
  }

  .breadcrumb-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

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

  .participant-editor-toolbar,
  .participant-row {
    grid-template-columns: 1fr;
  }

  #participant-editor-field {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .participant-fee-input {
    width: 100%;
  }

  #entity-form[data-view="projects"] .form-grid > [data-field-key],
  #entity-form[data-view="edit-project"] .form-grid > [data-field-key] {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 18px;
  }

  .toolbar-inline {
    width: 100%;
  }

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