:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #1f2329;
  --muted: #646a73;
  --line: #dee0e3;
  --soft: #f2f3f5;
  --accent: #3370ff;
  --accent-2: #f54a45;
  --warn: #d97008;
  --blue: #3370ff;
  --shadow: 0 1px 2px rgba(31, 35, 41, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

button {
  border: 0;
  border-radius: 6px;
  padding: 8px 13px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

button.secondary {
  color: #1f2329;
  border: 1px solid var(--line);
  background: #fff;
}

button.danger {
  background: var(--accent-2);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

input[disabled],
select[disabled],
textarea[disabled],
.readonly-field {
  background: #f7f8fa;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

input[type="date"].date-empty:not(:focus) {
  color: transparent;
}

input[type="date"].date-empty:not(:focus)::-webkit-datetime-edit,
input[type="date"].date-empty:not(:focus)::-webkit-datetime-edit-text,
input[type="date"].date-empty:not(:focus)::-webkit-datetime-edit-year-field,
input[type="date"].date-empty:not(:focus)::-webkit-datetime-edit-month-field,
input[type="date"].date-empty:not(:focus)::-webkit-datetime-edit-day-field {
  color: transparent;
}

input[type="date"].date-empty::-webkit-calendar-picker-indicator {
  opacity: 0.45;
}

input[type="date"]:focus,
input[type="date"]:not(.date-empty) {
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.12);
  outline: none;
}

.field-warning {
  border-color: var(--accent-2);
  background: #fff7f7;
}

.warning-text {
  color: var(--accent-2);
  font-size: 12px;
}

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

#app {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.18s ease;
}

#app.login-shell {
  display: block;
}

.sidebar {
  position: relative;
  z-index: 3;
  padding: 16px 0;
  border-right: 0;
  background: #078dbc;
  color: #fff;
  overflow: visible;
}

.brand {
  display: grid;
  gap: 5px;
  padding: 4px 14px 18px;
}

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

.brand span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.nav-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  border-radius: 0;
  padding: 0 18px;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-btn.active,
.nav-btn:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.16);
}

.nav-group-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  border-radius: 0;
  padding: 0 12px 0 18px;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

.nav-group-btn.active,
.nav-group-btn.open,
.nav-group-btn:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
}

.nav-group-btn.open::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-right: 10px solid #fff;
  border-bottom: 10px solid transparent;
  content: "";
  transform: translateY(-50%);
}

.nav-label {
  flex: 1;
}

.nav-caret {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
}

.nav-flyout {
  position: absolute;
  top: 92px;
  left: 148px;
  z-index: 20;
  width: 176px;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-left: 0;
  background: #fff;
  box-shadow: 2px 3px 8px rgba(31, 35, 41, 0.16);
}

.nav-flyout-title {
  padding: 9px 18px;
  color: #1f2329;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.nav-flyout-item {
  width: 100%;
  min-height: 38px;
  border-radius: 0;
  padding: 0 18px;
  color: #4e5969;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
}

.nav-flyout-item:hover,
.nav-flyout-item.active {
  color: #1f2329;
  background: #f2f3f5;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.topbar p {
  display: none;
}

.filter {
  display: grid;
  gap: 6px;
  width: 220px;
  color: var(--muted);
  font-size: 13px;
}

.page-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.login-page {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 10px;
}

.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

#content {
  padding: 16px 24px 40px;
}

.page-tabs {
  display: flex;
  align-items: stretch;
  min-height: 36px;
  padding-left: 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow-x: auto;
}

.page-tab {
  min-width: 96px;
  max-width: 180px;
  min-height: 36px;
  margin: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 0 10px;
  color: #646a73;
  background: #fafafa;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

.page-tab.active {
  color: #1f2329;
  background: #fff;
  font-weight: 600;
}

.page-tab-close {
  float: right;
  margin-left: 10px;
  color: #8f959e;
}

.page-tab-close:hover {
  color: #f54a45;
}

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

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

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

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

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

.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

.stat {
  min-height: 112px;
}

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

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.query-panel {
  padding: 10px 12px;
}

.query-panel h2 {
  font-size: 15px;
  margin-bottom: 8px;
}

.query-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.query-head h2 {
  margin-bottom: 0;
}

.query-form {
  grid-template-columns: repeat(8, minmax(96px, 1fr));
  gap: 6px;
}

.query-form label {
  gap: 3px;
  font-size: 11px;
}

.query-form input,
.query-form select {
  padding: 4px 7px;
  min-height: 28px;
  font-size: 12px;
}

.query-form button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f7f8fa;
  font-weight: 600;
}

.compact-table th,
.compact-table td {
  padding: 7px 8px;
  font-size: 13px;
  white-space: nowrap;
}

.subject-config {
  padding: 0;
  overflow: hidden;
}

.subject-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.subject-category-label {
  flex: 0 0 68px;
  color: var(--muted);
  font-weight: 600;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
}

.category-tab {
  min-height: 36px;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 0 18px;
  color: #4e5969;
  background: #fff;
  font-weight: 400;
  white-space: nowrap;
}

.category-tab:first-child {
  border-left: 1px solid var(--line);
}

.category-tab.active {
  color: #1f2329;
  background: #f2f3f5;
  font-weight: 600;
}

.subject-setting {
  margin-left: auto;
  white-space: nowrap;
}

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

.subject-search {
  display: flex;
  gap: 8px;
  width: min(760px, 100%);
}

.subject-search input:not([type="hidden"]) {
  min-width: 240px;
}

.subject-search select {
  width: 180px;
}

.subject-search button,
.subject-toolbar > button {
  min-width: 64px;
  white-space: nowrap;
}

.service-catalog-table th:nth-child(1),
.service-catalog-table td:nth-child(1) {
  width: 112px;
}

.service-catalog-table th:nth-child(2),
.service-catalog-table td:nth-child(2) {
  width: 96px;
}

.service-catalog-table th:nth-child(3),
.service-catalog-table td:nth-child(3) {
  width: 30%;
}

.service-catalog-table th:nth-child(4),
.service-catalog-table td:nth-child(4) {
  width: 160px;
}

.service-catalog-table th:nth-child(6),
.service-catalog-table td:nth-child(6) {
  width: 110px;
}

.muted-row {
  color: #8f959e;
  background: #fafafa;
}

.icon-action {
  min-width: 0;
  min-height: 24px;
  padding: 2px 6px;
  color: #646a73;
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
}

.status-pill {
  display: inline-block;
  min-width: 58px;
  border-radius: 3px;
  padding: 3px 8px;
  color: #646a73;
  background: #e5e6eb;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.good {
  color: #fff;
  background: #52c41a;
}

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

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

.option-setting-row input {
  max-width: 260px;
}

.multi-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.option-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.option-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px 4px 10px;
  background: #f7f8fa;
  font-size: 13px;
}

.option-tag button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  padding: 0;
  color: var(--muted);
  background: transparent;
  line-height: 18px;
}

.contract-config-selector {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) 220px 120px auto auto;
  gap: 10px;
  align-items: end;
}

.contract-config-main {
  padding: 0;
  overflow: hidden;
}

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

.contract-config-head h2 {
  margin-bottom: 4px;
}

.contract-config-total {
  display: grid;
  gap: 4px;
  color: var(--muted);
  text-align: right;
}

.contract-config-total strong {
  color: var(--ink);
  font-size: 20px;
}

.contract-line-form {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1.2fr) 86px 110px 110px 110px minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.contract-config-table th,
.contract-config-table td {
  vertical-align: middle;
}

.contract-config-table th:nth-child(10),
.contract-config-table td:nth-child(10) {
  width: 132px;
  overflow: visible;
}

.contract-config-table th:nth-child(5),
.contract-config-table td:nth-child(5) {
  width: 76px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.contract-config-table th:nth-child(8),
.contract-config-table td:nth-child(8) {
  width: 20%;
}

.contract-config-table th:nth-child(9),
.contract-config-table td:nth-child(9) {
  width: 78px;
}

.contract-config-table .actions {
  justify-content: flex-end;
  gap: 6px;
}

.contract-config-table .actions button {
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.project-item-entry-form {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) 140px minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
}

.project-item-total-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.project-item-total-actions .contract-config-total {
  min-width: 140px;
}

.project-item-line-form {
  display: grid;
  grid-template-columns: 150px minmax(220px, 1.4fr) 76px 96px 92px 92px minmax(120px, 1fr) 92px;
  gap: 8px;
  align-items: end;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.project-item-line-form label {
  min-width: 0;
}

.project-item-line-form input,
.project-item-line-form select {
  min-width: 0;
}

.project-item-add-btn {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.contract-config-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

tbody tr.row-overdue {
  background: #feeeed;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.truncate {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.invoice-no-link {
  cursor: pointer;
  color: #1668dc;
  border-bottom: 1px dashed #1668dc;
  user-select: none;
}

.invoice-no-link:hover {
  color: #0f53a8;
  border-bottom-color: #0f53a8;
}

.invoice-search-table {
  table-layout: fixed;
}

.invoice-search-table th:nth-child(3),
.invoice-search-table td:nth-child(3) {
  width: 22%;
}

.invoice-search-table th:nth-child(4),
.invoice-search-table td:nth-child(4) {
  width: 104px;
}

.invoice-search-table th:nth-child(7),
.invoice-search-table td:nth-child(7) {
  width: 140px;
}

.invoice-note {
  max-width: 140px;
  color: var(--muted);
  font-size: 12px;
}

.customer-table {
  table-layout: fixed;
  font-size: 13px;
}

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

.customer-table th:nth-child(1),
.customer-table td:nth-child(1) {
  width: 90px;
}

.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
  width: 34%;
}

.customer-name-cell {
  font-weight: 600;
  color: var(--ink);
}

.customer-table th:nth-child(3),
.customer-table td:nth-child(3),
.customer-table th:nth-child(4),
.customer-table td:nth-child(4) {
  width: 76px;
}

.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
  width: 120px;
}

.customer-table th:nth-child(6),
.customer-table td:nth-child(6) {
  width: 140px;
}

.customer-table th:nth-child(7),
.customer-table td:nth-child(7) {
  width: 190px;
}

.receivable-table {
  table-layout: fixed;
  font-size: 12px;
}

.receivable-table th,
.receivable-table td {
  padding: 6px 7px;
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

.receivable-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.receivable-table th:nth-child(1),
.receivable-table td:nth-child(1) {
  width: 54px;
}

.receivable-table th:nth-child(2),
.receivable-table td:nth-child(2) {
  width: 112px;
}

.payment-register-table {
  table-layout: fixed;
  font-size: 12px;
}

.payment-register-table th,
.payment-register-table td {
  padding: 6px 7px;
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

.payment-register-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.payment-register-table th:nth-child(1),
.payment-register-table td:nth-child(1) {
  width: 54px;
}

.payment-register-table th:nth-child(2),
.payment-register-table td:nth-child(2) {
  width: 90px;
}

.payment-register-table th:nth-child(3),
.payment-register-table td:nth-child(3) {
  width: 20%;
}

.payment-register-table th:nth-child(4),
.payment-register-table td:nth-child(4) {
  width: 100px;
}

.payment-register-table th:nth-child(5),
.payment-register-table td:nth-child(5) {
  width: 86px;
}

.payment-register-table th:nth-child(6),
.payment-register-table td:nth-child(6),
.payment-register-table th:nth-child(7),
.payment-register-table td:nth-child(7),
.payment-register-table th:nth-child(8),
.payment-register-table td:nth-child(8) {
  width: 88px;
}

.payment-register-table th:nth-child(9),
.payment-register-table td:nth-child(9) {
  width: 18%;
}

.payment-register-table th:nth-child(10),
.payment-register-table td:nth-child(10) {
  width: 70px;
}

.payment-search-table {
  table-layout: fixed;
  font-size: 12px;
}

.payment-search-table th,
.payment-search-table td {
  padding: 6px 7px;
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

.payment-search-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.payment-search-table th:nth-child(1),
.payment-search-table td:nth-child(1) {
  width: 100px;
}

.payment-search-table th:nth-child(2),
.payment-search-table td:nth-child(2),
.payment-search-table th:nth-child(3),
.payment-search-table td:nth-child(3) {
  width: 86px;
}

.payment-search-table th:nth-child(4),
.payment-search-table td:nth-child(4) {
  width: 20%;
}

.payment-search-table th:nth-child(5),
.payment-search-table td:nth-child(5),
.payment-search-table th:nth-child(6),
.payment-search-table td:nth-child(6) {
  width: 88px;
}

.payment-search-table th:nth-child(7),
.payment-search-table td:nth-child(7) {
  width: 16%;
}

.payment-search-table th:nth-child(8),
.payment-search-table td:nth-child(8) {
  width: 14%;
}

.payment-search-table th:nth-child(9),
.payment-search-table td:nth-child(9) {
  width: 132px;
  overflow: visible;
}

.payment-search-table .actions {
  justify-content: flex-end;
  gap: 6px;
}

.payment-search-table .actions button {
  padding: 5px 8px;
  font-size: 12px;
}

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

.receivable-table th:nth-child(3),
.receivable-table td:nth-child(3) {
  width: 22%;
}

.receivable-table th:nth-child(4),
.receivable-table td:nth-child(4) {
  width: 106px;
}

.receivable-table th:nth-child(5),
.receivable-table td:nth-child(5) {
  width: 86px;
}

.receivable-table th:nth-child(6),
.receivable-table td:nth-child(6),
.receivable-table th:nth-child(7),
.receivable-table td:nth-child(7),
.receivable-table th:nth-child(8),
.receivable-table td:nth-child(8) {
  width: 86px;
}

.receivable-table th:nth-child(9),
.receivable-table td:nth-child(9) {
  width: 82px;
}

.receivable-table th:nth-child(10),
.receivable-table td:nth-child(10) {
  width: 16%;
}

.receivable-table .tag {
  max-width: 100%;
  padding: 2px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.25;
  vertical-align: middle;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

.pager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager-actions button {
  white-space: nowrap;
}

.pager-jump {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pager-jump input {
  width: 64px;
  padding: 6px 8px;
  text-align: center;
}

.query-total-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.query-total-bar strong {
  color: var(--ink);
  font-size: 14px;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  background: #f2f3f5;
}

.tag.warn {
  color: #ad5a00;
  background: #fff7e8;
}

.tag.bad {
  color: #d83931;
  background: #feeeed;
}

.tag.good {
  color: #2b8f5b;
  background: #e9f8ef;
}

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

.actions {
  display: flex;
  gap: 8px;
}

.action-cell {
  position: relative;
}

.action-menu {
  position: absolute;
  right: 8px;
  z-index: 5;
  display: grid;
  gap: 6px;
  min-width: 96px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.action-menu button {
  width: 100%;
}

.chart-bar {
  display: grid;
  grid-template-columns: 100px 1fr 110px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.bar-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #edf0f5;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
}

.import-box {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 10px;
  align-items: end;
}

.workspace {
  margin-bottom: 16px;
}

.dashboard-filters {
  margin: -4px 0 16px;
  padding: 10px 12px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.shortcut-card {
  min-height: 52px;
  text-align: center;
}

.check-label {
  display: inline-flex;
  align-items: center;
  width: auto;
  gap: 6px;
}

.check-label input {
  width: auto;
}

.role-permission-form {
  display: grid;
  gap: 14px;
}

.role-permission-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.role-permission-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

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

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 35, 41, 0.32);
}

.modal-card {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 18px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(31, 35, 41, 0.18);
}

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

.modal-head h2 {
  margin: 0;
}

.modal-body {
  margin: 16px 0;
}

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

.detail-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8fa;
}

.detail-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-item strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
}

.detail-table th {
  width: 110px;
  background: #f7f8fa;
}

.detail-table td {
  white-space: pre-wrap;
}

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

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #1f2329;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: 0.22s ease;
}

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

.project-item-cards {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.project-customer-card h2 {
  margin-bottom: 12px;
}

.project-year-group {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.project-year-group + .project-year-group {
  margin-top: 16px;
}

.project-year-group h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.project-contract-group {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.project-contract-title,
.project-service-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: #f7f8fa;
}

.project-contract-title span {
  color: var(--primary);
  font-weight: 700;
}

.project-service-title {
  justify-content: flex-start;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.project-service-group table {
  table-layout: fixed;
  width: 100%;
  margin: 0;
  border-left: 0;
  border-right: 0;
}

.project-service-group th,
.project-service-group td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-service-group td.actions {
  overflow: visible;
}

.project-service-group th:nth-child(1),
.project-service-group td:nth-child(1) {
  width: 26%;
}

.project-service-group th:nth-child(2),
.project-service-group td:nth-child(2),
.project-service-group th:nth-child(3),
.project-service-group td:nth-child(3),
.project-service-group th:nth-child(6),
.project-service-group td:nth-child(6) {
  width: 92px;
}

.project-service-group th:nth-child(4),
.project-service-group td:nth-child(4) {
  width: 76px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.project-service-group th:nth-child(5),
.project-service-group td:nth-child(5) {
  width: 88px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.project-service-group th:nth-child(7),
.project-service-group td:nth-child(7) {
  width: 20%;
}

.project-service-group th:nth-child(8),
.project-service-group td:nth-child(8) {
  width: 78px;
}

.project-service-group th:nth-child(9),
.project-service-group td:nth-child(9) {
  width: 132px;
  overflow: visible;
}

.project-service-group .actions {
  justify-content: flex-end;
  gap: 6px;
}

.project-service-group .actions button {
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 980px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

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

  .filter {
    width: 100%;
  }
}
