:root {
  color-scheme: light;
  font-family:
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  --bg: #f2f5fa;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --border: #dbe3ee;
  --border-strong: #c8d4e3;
  --text: #172033;
  --muted: #6c788c;
  --blue: #315cfd;
  --blue-dark: #2448cc;
  --blue-soft: #edf2ff;
  --green: #07966f;
  --red: #d9485f;
  --amber: #b7791f;
  --shadow: 0 12px 32px rgba(22, 34, 59, 0.07);
  --shadow-hover: 0 18px 44px rgba(22, 34, 59, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--text);
  background: var(--bg);
}

body.login-active {
  min-width: 0;
}

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

button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 7px 11px;
  cursor: pointer;
}

button:hover {
  border-color: #9db2d4;
}

button.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

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

button.ghost {
  background: transparent;
}

button.small {
  padding: 4px 8px;
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
}

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

textarea.compact-textarea {
  min-height: 48px;
  height: 48px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

th {
  color: #4b5870;
  background: #f8fafc;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.current-user {
  min-width: 0;
  padding: 0 4px;
  text-align: right;
  line-height: 1;
}

.current-user strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(440px, 1.1fr);
  background: #f3f6fa;
}

.login-context {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(36px, 6vw, 84px);
  color: #fff;
  background: #17324d;
}

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

.login-brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #0f9f6e;
  font-size: 21px;
  font-weight: 800;
}

.login-product-name {
  font-size: 22px;
  font-weight: 800;
}

.login-product-note {
  margin-top: 4px;
  color: #cbd7e3;
  font-size: 13px;
}

.login-context-copy {
  max-width: 500px;
  display: grid;
  gap: 10px;
}

.login-context-copy strong {
  font-size: 32px;
  line-height: 1.3;
}

.login-context-copy span {
  max-width: 460px;
  color: #cbd7e3;
  font-size: 15px;
  line-height: 1.8;
}

.login-form-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px;
}

.login-form {
  width: min(390px, 100%);
}

.login-heading {
  margin-bottom: 30px;
}

.login-heading h1 {
  margin: 0;
  font-size: 28px;
}

.login-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
  color: #40506a;
  font-size: 13px;
  font-weight: 700;
}

.login-field input {
  height: 44px;
  font-size: 15px;
}

.login-error {
  min-height: 38px;
  margin: 2px 0 14px;
  padding: 9px 10px;
  border: 1px solid #f2b8b5;
  border-radius: 6px;
  color: #b42318;
  background: #fff5f4;
  font-size: 13px;
}

.login-error[hidden] {
  display: none;
}

.login-submit {
  width: 100%;
  height: 44px;
  font-weight: 700;
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2563eb, #10b981);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.top-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.nav-button {
  position: relative;
  width: auto;
  display: grid;
  grid-template-columns: 22px max-content;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  margin-bottom: 0;
  border-color: transparent;
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
}

.nav-button.active {
  border-color: #c8d8ff;
  background: #eef4ff;
  color: #1746a2;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: #edf2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.nav-button.active .nav-icon {
  background: #2563eb;
  color: #fff;
}

.nav-button[data-page='reminders'] {
  grid-template-columns: 22px max-content max-content;
  margin-left: auto;
}

.nav-badge {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 9px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.content {
  padding: 18px;
  overflow: auto;
  min-width: 0;
}

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

.page-head-actions-only {
  justify-content: flex-end;
}

.page-head-inline-note .page-head-title-block {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.page-head-inline-note .page-note {
  margin: 0;
  white-space: nowrap;
}

.page-title {
  margin: 0;
  font-size: 22px;
}

.page-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.grid.two {
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
}

.grid.material-grid {
  grid-template-columns: minmax(360px, 0.54fr) minmax(0, 1.46fr);
}

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

.dashboard-payment-summary {
  margin-top: 14px;
}

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

.panel {
  overflow: hidden;
}

.panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e8edf4;
}

.panel-title {
  font-weight: 800;
}

.contract-panel-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.panel-body {
  padding: 14px;
}

.table-wrap {
  max-height: 64vh;
  overflow: auto;
}

.excel-table {
  border: 1px solid #d7e0eb;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 100%;
}

.excel-table th,
.excel-table td {
  border: 1px solid #d7e0eb;
}

.contract-management-material-table th,
.contract-management-material-table td {
  height: 34px;
  padding: 5px 8px;
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-detail-table.contract-management-table th,
.project-detail-table.contract-management-table td {
  height: 32px;
  padding: 3px 7px;
  line-height: 1.2;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contract-management-table .tag {
  padding: 1px 6px;
  font-size: 11px;
}

.contract-management-table button.small {
  padding: 2px 6px;
  font-size: 11px;
}

.contract-management-table .selectable-row {
  cursor: pointer;
}

.contract-management-table .selectable-row:hover td,
.contract-management-table .selectable-row.selected td {
  background: #eef5ff;
}

.table-cell-link {
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-cell-link:hover {
  border-color: transparent;
  color: var(--blue);
}

.table-pagination {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.table-pagination-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.table-pagination button:disabled {
  cursor: default;
  opacity: 0.45;
}

.contract-material-detail-panel {
  margin-top: 14px;
}

.contract-material-detail-wrap {
  max-height: none;
}

.contract-management-material-table {
  table-layout: auto;
}

.contract-management-material-table tfoot td {
  background: #f8fafc;
  text-align: right;
}

.contract-management-material-table .contract-material-remark-cell {
  width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  vertical-align: top;
}

.project-summary-table {
  inline-size: auto;
  width: max-content;
  min-width: max-content;
}

.project-summary-table th,
.project-detail-table th {
  position: relative;
  cursor: pointer;
  padding-right: 18px;
  user-select: none;
}

.sort-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sort-mark {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.col-resizer {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  background: transparent;
  cursor: col-resize;
  pointer-events: auto;
  touch-action: none;
  z-index: 4;
}

.col-resizer::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 3px;
  bottom: 8px;
  width: 1px;
  background: transparent;
}

.col-resizer:hover::after,
.resizing-column .col-resizer::after {
  background: #2563eb;
}

.resizing-column {
  cursor: col-resize;
  user-select: none;
}

.project-workspace {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.project-side {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 112px);
}

.project-side-head {
  min-height: 38px;
  gap: 6px;
  padding: 6px 8px;
}

.project-side-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.project-side-title-row .muted {
  font-size: 12px;
}

.project-list-sort-select {
  width: 72px;
  min-width: 72px;
  height: 26px;
  padding: 2px 4px;
  font-size: 12px;
}

.project-tree-list {
  display: grid;
  gap: 0;
  max-height: calc(100vh - 174px);
  overflow: auto;
  padding: 4px 5px;
}

.project-tree-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.project-tree-row.manual-order {
  grid-template-columns: minmax(0, 1fr) auto;
}

.project-tree-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  column-gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 24px;
  padding: 3px 7px;
  background: #fff;
  text-align: left;
}

.project-tree-item.active {
  border-color: #b9ccff;
  background: #eef4ff;
  color: #143e8f;
}

.project-tree-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-order-buttons {
  display: grid;
  grid-auto-flow: column;
  gap: 1px;
  padding-left: 2px;
}

.project-order-button {
  width: 20px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}

.project-tree-meta {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.project-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.project-main > .panel > .panel-head {
  min-height: 29px;
  padding: 5px 9px;
}

.project-main > .panel > .panel-head .panel-title,
.project-main > .panel > .panel-head .contract-panel-title {
  font-size: 13px;
  line-height: 1.25;
}

.project-main > .panel > .panel-head .muted {
  font-size: 11px;
  line-height: 1.25;
}

.project-main > .panel > .panel-head button {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.project-main > .panel > .panel-head input {
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.project-title-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.project-title-row h2 {
  margin: 0;
  font-size: 22px;
}

.project-title-row p {
  margin: 0;
  color: var(--muted);
}

.project-title-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: #40506a;
  font-size: 14px;
}

.project-title-summary span {
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef2f7;
}

.project-overview-summary {
  margin-top: 0;
  font-size: 14px;
}

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

.table-search {
  min-width: 220px;
}

.project-contract-table {
  max-height: 42vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.project-contract-fixed-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.project-contract-table-shell {
  min-width: 0;
}

.project-contract-height-resizer {
  position: relative;
  height: 9px;
  border-top: 1px solid #d7e0eb;
  border-bottom: 1px solid #e8edf4;
  background: #f8fafc;
  cursor: ns-resize;
  user-select: none;
}

.project-contract-height-resizer::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  width: 44px;
  height: 2px;
  border-radius: 1px;
  background: #9aa9bc;
  transform: translateX(-50%);
}

.project-contract-height-resizer:hover::after,
.project-contract-height-resizer:focus-visible::after,
.resizing-project-contract-height .project-contract-height-resizer::after {
  background: #2563eb;
}

.project-contract-height-resizer:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.resizing-project-contract-height {
  cursor: ns-resize;
  user-select: none;
}

.project-contract-groups {
  display: grid;
  gap: 10px;
}

.project-contract-group {
  min-width: 0;
}

.project-contract-group-title {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-bottom: 1px solid #e8edf4;
  background: #fbfcfe;
  font-size: 13px;
  font-weight: 800;
}

.project-detail-table th,
.project-detail-table td {
  height: 38px;
  padding: 7px 9px;
  line-height: 1.35;
  vertical-align: middle;
}

.project-workspace .project-detail-table {
  font-size: 12px;
}

.project-workspace .project-detail-table th,
.project-workspace .project-detail-table td {
  height: 32px;
  padding: 4px 7px;
  line-height: 1.2;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-workspace .project-detail-table .tag {
  padding: 1px 6px;
  font-size: 11px;
}

.project-workspace .project-detail-table button.small {
  padding: 2px 6px;
  font-size: 11px;
}

.project-reimbursement-table {
  min-width: 1180px;
}

.table-wrap.compact {
  max-height: 30vh;
}

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

tr[data-action] {
  cursor: pointer;
}

.metric {
  padding: 14px;
}

.metric.mini {
  padding: 7px 9px;
  min-width: 136px;
}

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

.metric-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
}

.metric.mini .metric-label {
  font-size: 11px;
}

.metric.mini .metric-value {
  margin-top: 3px;
  font-size: 15px;
}

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

.toolbar select,
.toolbar input {
  width: auto;
  min-width: 180px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #eef2f7;
  color: #475569;
  white-space: nowrap;
}

.tag.income {
  background: #e8f7ef;
  color: #08734f;
}

.tag.expense {
  background: #fff0ef;
  color: #b42318;
}

.tag.warn {
  background: #fff7df;
  color: #9a6700;
}

.tag.done {
  background: #e6f4ff;
  color: #075985;
}

.amount.income {
  color: var(--green);
  font-weight: 800;
}

.amount.expense,
.amount.negative {
  color: var(--red);
  font-weight: 800;
}

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

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.project-empty-state {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}

.project-empty-state strong {
  color: var(--text);
  font-size: 18px;
}

.project-empty-state button {
  margin-top: 4px;
}

.finance-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: auto;
  margin-bottom: 0;
  align-items: center;
}

.finance-tabs button {
  width: 100%;
  min-width: 0;
  padding: 6px 4px;
  font-size: 12px;
  white-space: nowrap;
}

.finance-tabs button.active {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}

.finance-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.finance-filter-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 4px 0 6px;
}

.finance-filter-toolbar select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 8px;
}

.finance-action-slot {
  min-height: 30px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.finance-action-slot:empty {
  min-width: 96px;
}

.finance-action-slot button {
  padding: 6px 10px;
  white-space: nowrap;
}

.finance-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 8px;
}

.finance-title-block {
  min-height: 112px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.finance-title-block .page-title {
  font-size: 28px;
  line-height: 1.1;
}

.finance-mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(136px, 1fr));
  gap: 8px;
  width: 100%;
}

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

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

.system-info > div {
  min-height: 54px;
  padding: 10px 12px;
  border-right: 1px solid #e8edf4;
  border-bottom: 1px solid #e8edf4;
}

.system-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.system-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.system-cert-panel {
  margin-top: 14px;
}

.system-device-panel {
  margin-top: 14px;
}

.system-device-note {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.login-device-table {
  min-width: 1080px;
}

.login-device-table td {
  vertical-align: middle;
}

.system-backup-panel {
  margin-top: 14px;
}

.backup-settings {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  font-size: 13px;
}

.backup-settings label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.backup-settings input[type="time"] {
  width: 116px;
}

.backup-settings input[type="number"] {
  width: 78px;
}

.backup-toggle input {
  width: 16px;
  height: 16px;
}

.backup-last-run {
  margin-left: auto;
  color: var(--muted);
}

.backup-table-wrap {
  max-height: 300px;
}

.backup-table {
  width: 100%;
  table-layout: fixed;
}

.backup-table th:nth-child(1) { width: 34%; }
.backup-table th:nth-child(2) { width: 14%; }
.backup-table th:nth-child(3) { width: 22%; }
.backup-table th:nth-child(4) { width: 12%; }
.backup-table th:nth-child(5) { width: 18%; }

.backup-table td {
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-error {
  color: #b91c1c;
}

.system-log-panel {
  margin-top: 14px;
}

.system-log-panel .toolbar select {
  min-width: 140px;
}

.system-log-panel .table-search {
  width: 240px;
}

.system-log-table-wrap {
  max-height: 380px;
}

.audit-log-table td {
  vertical-align: middle;
}

.audit-target-type {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}

.audit-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

dialog {
  width: min(760px, calc(100vw - 40px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}

dialog.contract-dialog {
  width: min(1040px, calc(100vw - 40px));
  max-height: calc(100vh - 24px);
}

dialog.contract-dialog #recordForm {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 24px);
}

dialog.contract-dialog .dialog-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 8px 16px;
}

dialog.contract-dialog .dialog-head,
dialog.contract-dialog .dialog-foot {
  padding-top: 6px;
  padding-bottom: 6px;
}

dialog.contract-dialog .form-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 6px;
}

dialog.contract-dialog .contract-project-field {
  grid-column: span 6;
}

dialog.contract-dialog .contract-type-field,
dialog.contract-dialog .contract-responsible-field {
  grid-column: span 3;
}

dialog.contract-dialog .contract-wide-field {
  grid-column: span 8;
}

dialog.contract-dialog .contract-narrow-field {
  grid-column: span 4;
}

@media (max-width: 760px) {
  dialog.contract-dialog .form-grid {
    grid-template-columns: 1fr;
  }

  dialog.contract-dialog .contract-project-field,
  dialog.contract-dialog .contract-type-field,
  dialog.contract-dialog .contract-responsible-field,
  dialog.contract-dialog .contract-wide-field,
  dialog.contract-dialog .contract-narrow-field {
    grid-column: 1 / -1;
  }
}

dialog.contract-dialog .field label {
  margin-bottom: 3px;
}

dialog.contract-dialog .help {
  margin-top: 2px;
  line-height: 1.2;
}

dialog.contract-dialog .attachment-field {
  gap: 6px;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

dialog.password-confirm-dialog {
  width: min(420px, calc(100vw - 32px));
}

.password-confirm-copy {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.password-confirm-error {
  min-height: 20px;
  margin-top: 6px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}

.dialog-title {
  font-size: 18px;
  font-weight: 800;
}

.dialog-body {
  padding: 16px;
  max-height: 70vh;
  overflow: auto;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel-soft);
}

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

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

.field label {
  display: block;
  margin-bottom: 5px;
  color: #40506a;
  font-size: 12px;
  font-weight: 700;
}

.company-picker-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.company-picker-button {
  white-space: nowrap;
}

.company-picker-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.company-picker-option {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
}

.company-picker-option:hover,
.company-picker-option:focus-visible {
  background: #eef5ff;
}

.company-picker-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.attachment-field {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.contract-material-field {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.contract-material-head {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.contract-material-head label {
  margin: 0 !important;
  font-size: 13px;
}

.contract-material-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 4px 8px;
  background: #fff;
}

.contract-material-subhead strong {
  font-size: 12px;
}

.contract-material-section + .contract-material-section {
  border-top: 1px solid var(--border);
}

.contract-material-columns,
.contract-material-row {
  display: grid;
  grid-template-columns: 120px minmax(190px, 1.7fr) 120px 70px 74px 96px 100px 58px;
  gap: 6px;
  align-items: center;
}

.contract-material-columns {
  min-height: 22px;
  padding: 2px 8px;
  color: var(--muted);
  background: #fbfcfe;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
}

.contract-material-list {
  max-height: none;
  overflow: visible;
}

.contract-material-row {
  min-height: 34px;
  padding: 2px 8px;
  border-bottom: 1px solid #edf1f6;
  font-size: 12px;
}

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

.contract-material-row select,
.contract-material-row input {
  min-width: 0;
  height: 28px;
  padding: 4px 6px;
  font-size: 12px;
}

.contract-material-row strong {
  white-space: nowrap;
}

dialog.contract-dialog {
  font-size: 14px;
  line-height: 1.4;
}

dialog.contract-dialog .dialog-title {
  font-size: 20px;
  line-height: 1.3;
}

dialog.contract-dialog .field > label {
  font-size: 13px;
  line-height: 1.35;
}

dialog.contract-dialog input,
dialog.contract-dialog select,
dialog.contract-dialog textarea,
dialog.contract-dialog button {
  font-size: 14px;
}

dialog.contract-dialog button.small {
  font-size: 13px;
}

dialog.contract-dialog .help,
dialog.contract-dialog .company-picker-empty,
dialog.contract-dialog .attachment-empty {
  font-size: 12px;
}

dialog.contract-dialog .contract-material-head label {
  font-size: 14px;
}

dialog.contract-dialog .contract-material-subhead strong,
dialog.contract-dialog .contract-material-row {
  font-size: 13px;
}

dialog.contract-dialog .contract-material-columns {
  min-height: 24px;
  font-size: 12px;
}

dialog.contract-dialog .contract-material-row {
  min-height: 36px;
}

dialog.contract-dialog .contract-material-row select,
dialog.contract-dialog .contract-material-row input {
  height: 30px;
  font-size: 13px;
}

dialog.reimbursement-dialog {
  width: min(1040px, calc(100vw - 40px));
  max-height: calc(100vh - 24px);
}

dialog.reimbursement-dialog #recordForm {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
}

dialog.reimbursement-dialog .dialog-body {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.reimbursement-items-field {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.reimbursement-items-head {
  min-width: 850px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.reimbursement-items-head label {
  margin: 0;
  font-size: 13px;
}

.reimbursement-item-columns,
.reimbursement-item-row {
  min-width: 900px;
  display: grid;
  grid-template-columns: 125px minmax(180px, 1.6fr) 110px 70px 80px 100px 90px 58px;
  gap: 6px;
  align-items: center;
}

.reimbursement-item-columns {
  min-height: 26px;
  padding: 3px 8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #fbfcfe;
  font-size: 11px;
  font-weight: 700;
}

.reimbursement-item-row {
  min-height: 40px;
  padding: 4px 8px;
  border-bottom: 1px solid #edf1f6;
  font-size: 12px;
}

.reimbursement-item-row input,
.reimbursement-item-row select {
  min-width: 0;
  height: 32px;
  padding: 5px 7px;
  font-size: 13px;
}

.reimbursement-item-row strong {
  white-space: nowrap;
}

.reimbursement-total-row {
  min-width: 900px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  min-height: 38px;
  padding: 6px 74px 6px 8px;
  background: #f8fafc;
  font-size: 13px;
}

.reimbursement-total-row strong {
  min-width: 100px;
  color: var(--danger);
  font-size: 15px;
}

.invoice-ocr-field {
  display: grid;
  justify-items: start;
  gap: 7px;
  padding: 10px;
  border: 1px dashed #b8c7dc;
  border-radius: 6px;
  background: #f8fbff;
}

.invoice-ocr-field .help {
  margin: 0;
}

.invoice-ocr-field .help[data-state="loading"] {
  color: #1d4ed8;
}

.invoice-ocr-field .help[data-state="success"] {
  color: #047857;
}

.invoice-ocr-field .help[data-state="warning"] {
  color: #a16207;
}

.invoice-ocr-field .help[data-state="error"] {
  color: #b91c1c;
}

.attachment-list {
  width: 100%;
  display: grid;
  gap: 6px;
}

.attachment-empty {
  padding: 8px 0;
}

.attachment-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.attachment-item a {
  min-width: 0;
  overflow: hidden;
  color: #1746a2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-attachment-links {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.summary-attachment-links a,
.summary-attachment-links span {
  min-width: 0;
  overflow: hidden;
  color: #1746a2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-reminder-panel {
  margin-top: 10px;
  border-top: 3px solid #d97706;
}

.reminder-page-empty {
  min-height: 96px;
}

.invoice-reminder-panel .panel-head {
  padding-block: 8px;
}

.invoice-reminder-group + .invoice-reminder-group {
  border-top: 1px solid var(--border);
}

.invoice-reminder-group-title {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  background: #fff7ed;
  color: #9a3412;
}

.receipt-reminders .invoice-reminder-group-title {
  background: #ecfdf5;
  color: #047857;
}

.invoice-reminder-group-title span {
  color: var(--muted);
  font-size: 12px;
}

.invoice-reminder-table {
  width: 100%;
  table-layout: fixed;
}

.invoice-reminder-table th,
.invoice-reminder-table td {
  padding-block: 5px;
  vertical-align: middle;
}

.invoice-reminder-table .text-link {
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-reminder-difference {
  color: #b91c1c;
  font-weight: 700;
}

.invoice-reminder-time {
  width: 100%;
  min-width: 156px;
  height: 28px;
  padding: 3px 6px;
  font-size: 12px;
}

.invoice-reminder-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

.invoice-reminder-paused {
  border-top: 1px solid var(--border);
}

.invoice-reminder-paused summary {
  padding: 8px 10px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.compact-empty {
  min-height: 34px;
  padding: 9px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  border-radius: 8px;
  padding: 10px 12px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
  .backup-settings {
    flex-wrap: wrap;
  }

  .backup-last-run {
    width: 100%;
    margin-left: 0;
  }

  .finance-head {
    grid-template-columns: 1fr;
  }

  .finance-title-block {
    min-height: auto;
  }

  .finance-tabs {
    margin-top: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .finance-mini-metrics {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .project-workspace {
    grid-template-columns: 1fr;
  }

  .project-side {
    position: static;
    max-height: none;
  }

  .project-tree-list {
    max-height: none;
  }

  .project-overview-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

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

  .login-context-copy {
    display: none;
  }

  .login-form-panel {
    min-height: auto;
    place-items: start stretch;
    padding: 42px 24px;
  }
}

@media (max-width: 760px) {
  .finance-filter-toolbar {
    grid-template-columns: 1fr;
  }

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

  .finance-mini-metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .project-title-row {
    display: grid;
  }

  .project-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* 2026 premium visual refresh: presentation only, no business logic changes. */
body {
  background:
    radial-gradient(circle at 8% 0%, rgba(49, 92, 253, 0.055), transparent 25%),
    linear-gradient(180deg, #f7f9fc 0, var(--bg) 190px);
  letter-spacing: 0.005em;
}

body.login-active {
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 12% 18%, rgba(49, 92, 253, 0.14), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(8, 150, 111, 0.12), transparent 28%),
    #edf2f8;
}

body.login-active #app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

button,
input,
select,
textarea {
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease,
    color 150ms ease, transform 150ms ease;
}

button {
  min-height: 34px;
  border-color: var(--border);
  border-radius: 9px;
  padding: 7px 12px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
  box-shadow: 0 1px 2px rgba(22, 34, 59, 0.04);
  font-weight: 600;
}

button:hover {
  border-color: #aebed2;
  background: #fff;
  box-shadow: 0 6px 16px rgba(22, 34, 59, 0.08);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: rgba(49, 92, 253, 0.75);
  box-shadow: 0 0 0 3px rgba(49, 92, 253, 0.14);
}

button.primary {
  border-color: #315cfd;
  background: linear-gradient(135deg, #3f6cff, #284ed8);
  box-shadow: 0 8px 18px rgba(49, 92, 253, 0.23);
}

button.primary:hover {
  border-color: #2448cc;
  background: linear-gradient(135deg, #315cfd, #2448cc);
  box-shadow: 0 11px 24px rgba(49, 92, 253, 0.3);
}

button.danger {
  border-color: #f0c7ce;
  background: #fffafb;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  transform: none;
}

button.small {
  min-height: 26px;
}

.table-cell-link,
.invoice-reminder-table .text-link {
  min-height: 0;
  box-shadow: none;
  transform: none;
}

.contract-management-table button.small,
.project-workspace .project-detail-table button.small {
  min-height: 22px;
}

input,
select,
textarea {
  border-color: var(--border);
  border-radius: 9px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(22, 34, 59, 0.025);
}

.login-screen {
  position: relative;
  width: min(760px, calc(100vw - 40px));
  min-height: 480px;
  display: grid;
  grid-template-columns: minmax(285px, 0.88fr) minmax(360px, 1.12fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 34px 80px rgba(29, 44, 72, 0.18),
    0 4px 16px rgba(29, 44, 72, 0.08);
}

.login-context {
  position: relative;
  isolation: isolate;
  min-height: 480px;
  overflow: hidden;
  padding: 34px 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 40%),
    linear-gradient(155deg, #132e53 0%, #1c4172 55%, #176d70 125%);
}

.login-context::before,
.login-context::after {
  content: '';
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.login-context::before {
  width: 260px;
  height: 260px;
  right: -150px;
  top: -105px;
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.025);
}

.login-context::after {
  width: 180px;
  height: 180px;
  left: -105px;
  bottom: -85px;
  box-shadow: 0 0 0 32px rgba(255, 255, 255, 0.02);
}

.login-brand-block {
  gap: 12px;
}

.login-brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: linear-gradient(145deg, #3e78ff, #0fb58d);
  box-shadow: 0 10px 24px rgba(5, 19, 45, 0.24);
}

.login-product-name {
  font-size: 19px;
  letter-spacing: 0.03em;
}

.login-product-note {
  color: rgba(232, 240, 250, 0.72);
  font-size: 12px;
}

.login-context-copy {
  display: grid;
  gap: 12px;
}

.login-context-copy::before {
  content: 'PROJECT OPERATIONS';
  width: max-content;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(235, 245, 255, 0.76);
  background: rgba(255, 255, 255, 0.06);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.login-context-copy strong {
  max-width: 250px;
  font-size: 28px;
  line-height: 1.32;
}

.login-context-copy span {
  color: rgba(225, 235, 246, 0.76);
  font-size: 13px;
  line-height: 1.75;
}

.login-form-panel {
  min-height: 480px;
  padding: 36px 42px;
  background: linear-gradient(160deg, #fff 10%, #f9fbfe 100%);
}

.login-form {
  width: min(350px, 100%);
}

.login-heading {
  margin-bottom: 24px;
}

.login-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.login-heading h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.login-heading p {
  margin-top: 7px;
}

.login-field {
  gap: 6px;
  margin-bottom: 15px;
  color: #3e4c63;
}

.login-field input {
  height: 43px;
  padding-inline: 12px;
}

.login-submit {
  height: 44px;
  margin-top: 4px;
  border-radius: 10px;
}

.login-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  color: #8490a3;
  font-size: 11px;
}

.login-secure-note span {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #078664;
  background: #e6f8f2;
  font-size: 10px;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  height: 64px;
  padding: 0 22px;
  border-bottom-color: rgba(210, 220, 234, 0.82);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(22, 34, 59, 0.045);
  backdrop-filter: blur(16px);
}

.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 11px;
  background: linear-gradient(140deg, #315cfd 5%, #1887bd 52%, #0ba67d 100%);
  box-shadow: 0 8px 18px rgba(49, 92, 253, 0.22);
}

.brand-mark::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  top: -10px;
  right: -8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.brand-title {
  color: #142039;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  margin-top: 2px;
  color: #7b8799;
  font-size: 11px;
}

.current-user {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
}

.top-nav {
  gap: 6px;
  padding: 9px 18px;
  border-bottom-color: rgba(210, 220, 234, 0.82);
  background: rgba(255, 255, 255, 0.9);
}

.nav-button {
  min-height: 38px;
  border-radius: 10px;
  padding: 7px 11px;
  color: #4a566b;
  background: transparent;
  box-shadow: none;
}

.nav-button:hover {
  border-color: transparent;
  color: #2646a5;
  background: #f1f5ff;
  box-shadow: none;
}

.nav-button.active {
  border-color: #d8e1ff;
  color: #2449c6;
  background: linear-gradient(180deg, #f2f5ff, #eaf0ff);
  box-shadow: inset 0 0 0 1px rgba(49, 92, 253, 0.03), 0 4px 12px rgba(49, 92, 253, 0.08);
}

.nav-icon {
  border-radius: 7px;
  background: #edf1f6;
}

.nav-button.active .nav-icon {
  background: linear-gradient(145deg, #4773ff, #2d53db);
  box-shadow: 0 4px 10px rgba(49, 92, 253, 0.22);
}

.nav-badge {
  box-shadow: 0 3px 8px rgba(217, 72, 95, 0.24);
}

.content {
  padding: 20px 22px 26px;
}

.page-head {
  margin-bottom: 16px;
}

.page-title {
  color: #17223a;
  font-size: 23px;
  letter-spacing: -0.015em;
}

.page-note {
  margin-top: 5px;
  color: #7a8699;
}

.panel,
.metric {
  border-color: rgba(214, 224, 237, 0.94);
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.panel {
  background: rgba(255, 255, 255, 0.97);
}

.panel-head {
  min-height: 50px;
  border-bottom-color: #e8edf4;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.panel-title {
  color: #22304a;
  letter-spacing: 0.01em;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 15px 16px;
  background: linear-gradient(145deg, #fff, #fbfcff);
}

.metric::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #315cfd, #7b9aff);
  opacity: 0.9;
}

.grid.three .metric:nth-child(3n + 2)::before {
  background: linear-gradient(90deg, #07966f, #5ecfae);
}

.grid.three .metric:nth-child(3n)::before {
  background: linear-gradient(90deg, #6f56d9, #ad91ff);
}

.metric-label {
  color: #7b8798;
  font-weight: 600;
}

.metric-value {
  color: #17233c;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.table-wrap {
  scrollbar-color: #b8c5d6 transparent;
  scrollbar-width: thin;
}

th {
  color: #536078;
  background: #f6f8fb;
  font-size: 12px;
  letter-spacing: 0.015em;
}

tbody tr {
  transition: background-color 130ms ease;
}

tbody tr:hover td {
  background: #f6f8ff;
}

.excel-table,
.excel-table th,
.excel-table td {
  border-color: #dde5ef;
}

.selected-row td,
.contract-management-table .selectable-row.selected td {
  background: #edf2ff;
}

.tag {
  border: 1px solid rgba(132, 147, 169, 0.12);
  font-weight: 600;
}

.finance-tabs {
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #f3f6fa;
}

.finance-tabs button {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.finance-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #334155, #182235);
  box-shadow: 0 6px 14px rgba(22, 34, 59, 0.18);
}

.project-tree-item {
  border-radius: 8px;
}

.project-tree-item:hover {
  background: #f5f7fb;
}

.project-tree-item.active {
  border-color: #c9d6ff;
  background: linear-gradient(90deg, #edf2ff, #f5f7ff);
  box-shadow: inset 3px 0 #315cfd;
}

dialog {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 28, 52, 0.3);
}

dialog::backdrop {
  background: rgba(19, 30, 48, 0.46);
  backdrop-filter: blur(3px);
}

.dialog-head {
  min-height: 56px;
  background: linear-gradient(180deg, #fff, #fafbfd);
}

.dialog-title {
  color: #1d2940;
  font-size: 18px;
}

.dialog-foot {
  background: #f7f9fc;
}

.company-picker-menu {
  border-radius: 10px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
}

.toast {
  right: 22px;
  bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  padding: 11px 14px;
  background: rgba(20, 31, 50, 0.95);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(12px);
}

.workspace-loading-shell {
  min-height: 100vh;
  background: var(--bg);
}

.workspace-loading-nav .nav-button {
  cursor: default;
  user-select: none;
}

.workspace-loading-content {
  display: grid;
  min-height: calc(100vh - 126px);
  place-items: center;
}

.workspace-loading-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: min(420px, calc(100vw - 40px));
  padding: 24px 28px;
  border: 1px solid rgba(202, 212, 228, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(25, 42, 70, 0.12);
}

.workspace-loading-card div {
  display: grid;
  gap: 5px;
}

.workspace-loading-card strong {
  color: #1d2940;
  font-size: 17px;
}

.workspace-loading-card div span {
  color: var(--muted);
  font-size: 13px;
}

.workspace-loading-spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 3px solid #dfe6ff;
  border-top-color: #315cfd;
  border-radius: 50%;
  animation: workspace-loading-spin 0.75s linear infinite;
}

@keyframes workspace-loading-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 680px) {
  body.login-active #app {
    padding: 14px;
  }

  .login-screen {
    width: min(430px, calc(100vw - 28px));
    min-height: 0;
    grid-template-columns: 1fr;
  }

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

  .login-context-copy {
    display: none;
  }

  .login-form-panel {
    min-height: auto;
    padding: 30px 24px 26px;
  }
}
