:root {
  --ink: #18251e;
  --muted: #68766d;
  --line: #dfe7e2;
  --page: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #edf3ef;
  --brand: #0d79bd;
  --brand-deep: #075181;
  --brand-mid: #2e9fdc;
  --brand-soft: #e8f5fd;
  --success: #16835c;
  --success-soft: #e8f7f1;
  --warning: #bf7607;
  --warning-soft: #fff4df;
  --danger: #c83c43;
  --danger-soft: #fff0ef;
  --num: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--page);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
}

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

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

h1 {
  font-size: 25px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 17px;
  font-weight: 500;
}

h3 {
  font-size: 14px;
  font-weight: 500;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: #c96632;
  box-shadow: inset 0 -7px 14px rgba(80, 28, 5, 0.3);
  font-size: 17px;
  font-weight: 500;
}

.app {
  width: 100%;
  max-width: 1240px;
  min-height: 720px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--page);
  box-shadow: 0 26px 80px rgba(10, 27, 17, 0.14);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 12px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 76% -40%, rgba(197, 102, 49, 0.38), transparent 35%),
    linear-gradient(132deg, #063c62, var(--brand));
}

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

.brand-copy {
  min-width: 0;
}

.brand-title {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
}

.top-actions,
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  min-height: 40px;
  padding: 4px 11px 4px 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  white-space: nowrap;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--brand);
  background: #e8f1f5;
  font-size: 11px;
  font-weight: 500;
}

.user-meta strong {
  font-size: 12px;
  font-weight: 500;
}

.user-meta span {
  color: rgba(255, 255, 255, 0.63);
  font-size: 10px;
}

.logout-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 99px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 650px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.side-label {
  padding: 0 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.side-nav {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.side-nav button {
  min-height: 43px;
  padding: 0 11px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.side-nav button.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 500;
}

.side-note {
  margin-top: auto;
  padding: 13px;
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 10px;
}

.side-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 500;
}

.mobile-nav {
  display: none;
  gap: 5px;
  padding: 9px 11px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.mobile-nav button {
  flex: 1 1 0;
  min-width: max-content;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}

.mobile-nav button.active {
  border-color: var(--line);
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 500;
}

.main {
  min-width: 0;
  padding: 22px 24px 28px;
}

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

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

.page-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-button,
.secondary-button,
.text-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--brand);
  color: #fff;
  background: linear-gradient(180deg, var(--brand-mid), var(--brand));
  box-shadow: 0 7px 16px rgba(13, 121, 189, 0.18);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.text-button {
  min-height: 34px;
  padding: 0 7px;
  border: 0;
  color: var(--brand);
  background: transparent;
}

.danger-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #ecc8ca;
  color: var(--danger);
  background: var(--surface);
  font-size: 11px;
}

.primary-button:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.wide {
  width: 100%;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 13px;
  padding: 10px 12px;
  border: 1px solid #cce5f4;
  border-radius: 11px;
  color: #245a78;
  background: var(--brand-soft);
  font-size: 11px;
}

.notice.warning {
  border-color: #f1ddb7;
  color: #71500f;
  background: var(--warning-soft);
}

.stats {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.stat.primary {
  color: #fff;
  border-color: var(--brand);
  background:
    radial-gradient(circle at 90% 0%, rgba(201, 102, 50, 0.43), transparent 35%),
    linear-gradient(142deg, var(--brand-deep), var(--brand));
}

.stat-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.stat.primary .stat-label {
  color: rgba(255, 255, 255, 0.68);
}

.stat-value {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-family: var(--num);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.stat.primary .stat-note {
  color: rgba(255, 255, 255, 0.65);
}

.progress {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #e5b369;
}

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

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.service-list {
  display: grid;
}

.service-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

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

.service-row strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.money {
  overflow: hidden;
  font-family: var(--num);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money.out {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.money.in {
  color: var(--brand);
  font-size: 14px;
  font-weight: 500;
}

.category-list {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.category-row {
  display: grid;
  gap: 6px;
}

.category-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.category-top span:last-child {
  color: var(--muted);
  font-family: var(--num);
}

.track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-2);
}

.track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-mid);
}

.empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 45px 18px;
  color: var(--muted);
  text-align: center;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(105px, 0.45fr)) minmax(245px, 1fr);
  gap: 8px;
  margin-bottom: 11px;
}

.search-box {
  position: relative;
}

.search-box span {
  position: absolute;
  left: 12px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  padding-left: 36px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 121, 189, 0.13);
}

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

.date-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 5px;
  align-items: center;
  min-height: 44px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.date-range input {
  min-height: 36px;
  padding: 3px;
  border: 0;
  background: transparent;
  font-size: 11px;
}

.date-range span {
  color: var(--muted);
  font-size: 10px;
}

.summary-strip,
.page-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.summary-strip > div,
.page-summary > div {
  min-width: 0;
  padding: 10px 11px;
  background: var(--surface);
}

.summary-strip span,
.page-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.summary-strip strong,
.page-summary strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--num);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

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

th {
  height: 40px;
  padding: 8px 11px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

td {
  height: 60px;
  padding: 9px 11px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  vertical-align: middle;
}

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

.cell-main {
  min-width: 150px;
}

.cell-main strong {
  display: block;
  font-weight: 500;
}

.cell-main small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 99px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 10px;
  white-space: nowrap;
}

.tag.green {
  color: var(--success);
  background: var(--success-soft);
}

.tag.blue {
  color: var(--brand);
  background: var(--brand-soft);
}

.tag.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

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

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

.pager-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.pager-actions button:disabled {
  opacity: 0.42;
}

.page-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 10px;
  margin-bottom: 0;
}

.mobile-list {
  display: none;
}

.mobile-item {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  text-align: left;
}

.mobile-item-top,
.mobile-item-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.mobile-item-foot {
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 12px;
  align-items: start;
}

.form-panel {
  padding: 17px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 5px;
}

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

.field label,
.field > span:first-child {
  color: var(--muted);
  font-size: 11px;
}

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

.amount-field {
  position: relative;
}

.amount-field > span {
  position: absolute;
  left: 12px;
  top: 14px;
  color: var(--muted);
  font-size: 18px;
}

.amount-field input {
  height: 54px;
  padding-left: 34px;
  font-family: var(--num);
  font-size: 23px;
  font-weight: 500;
}

.linked-row {
  display: flex;
  gap: 7px;
}

.linked-row input {
  min-width: 0;
  flex: 1;
}

.contract-picker {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.contract-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 45px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
}

.contract-option strong,
.contract-option span {
  display: block;
}

.contract-option strong {
  font-size: 12px;
  font-weight: 500;
}

.contract-option span {
  color: var(--muted);
  font-size: 10px;
}

.selected-contract {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  color: #255a7e;
  background: var(--brand-soft);
  font-size: 10px;
}

.selected-contract button {
  min-height: 30px;
  border: 0;
  color: inherit;
  background: transparent;
}

.upload-box {
  display: grid;
  place-items: center;
  min-height: 104px;
  padding: 13px;
  border: 1px dashed #9fc5d8;
  border-radius: 12px;
  color: #2d6e90;
  background: var(--brand-soft);
  text-align: center;
}

.upload-box strong {
  font-size: 12px;
  font-weight: 500;
}

.upload-box span {
  color: var(--muted);
  font-size: 10px;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.side-panel {
  padding: 16px;
}

.operator-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  padding: 11px;
  border-radius: 12px;
  background: var(--surface-2);
}

.operator-card strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}

.operator-card span {
  color: var(--muted);
  font-size: 10px;
}

.check-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.check-list div {
  padding-left: 13px;
  position: relative;
}

.check-list div::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--brand);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  margin: -4px 0 7px -7px;
  padding: 0 7px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}

.detail-grid,
.contract-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.detail-hero {
  padding: 22px 17px 18px;
  text-align: center;
}

.detail-hero .money {
  display: block;
  margin-top: 7px;
  font-size: 34px;
  font-weight: 500;
}

.detail-hero p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.detail-rows {
  display: grid;
  padding: 4px 16px 14px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

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

.detail-row .label {
  color: var(--muted);
}

.detail-row .value {
  max-width: 66%;
  text-align: right;
  overflow-wrap: anywhere;
}

.linked-contract {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 15px 14px;
  padding: 11px 12px;
  border: 1px solid #c8e2f1;
  border-radius: 11px;
  background: var(--brand-soft);
}

.linked-contract strong,
.linked-contract span {
  display: block;
}

.linked-contract strong {
  font-size: 12px;
  font-weight: 500;
}

.linked-contract span {
  color: var(--muted);
  font-size: 10px;
}

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

.photo-card {
  display: grid;
  place-items: center;
  min-height: 130px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: contain;
}

.photo-card a {
  padding: 16px;
  color: var(--brand);
  text-align: center;
  text-decoration: none;
}

.timeline {
  display: grid;
  padding: 8px 16px 14px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  min-height: 52px;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline-dot {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border: 5px solid #dff2e9;
  border-radius: 50%;
  background: var(--success);
}

.timeline-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
}

.timeline-copy span {
  color: var(--muted);
  font-size: 10px;
}

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

.contract-item {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}

.contract-item h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-item p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.contract-item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.error-box {
  display: none;
  margin-top: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 11px;
}

.error-box.show {
  display: block;
}

.temp-password {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #b9def3;
  border-radius: 13px;
  background: var(--brand-soft);
}

.temp-password code {
  display: inline-block;
  margin-top: 5px;
  padding: 5px 8px;
  border: 1px dashed #87bedf;
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--num);
  font-size: 15px;
  user-select: all;
}

.temp-password-actions {
  display: flex;
  gap: 7px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.account-actions button {
  min-height: 33px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 10px;
  white-space: nowrap;
}

.account-actions button:last-child {
  color: var(--danger);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--success);
  font-size: 10px;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

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

.toast {
  position: fixed;
  z-index: 100;
  top: 16px;
  left: 50%;
  max-width: calc(100vw - 28px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(13, 37, 23, 0.18);
  transform: translateX(-50%);
  font-size: 11px;
}

.toast[hidden] {
  display: none;
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(13, 121, 189, 0.12), transparent 30%),
    var(--page);
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(370px, 0.95fr);
  width: min(1080px, calc(100% - 28px));
  min-height: 650px;
  margin: 24px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(10, 27, 17, 0.14);
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 5%, rgba(201, 102, 50, 0.5), transparent 31%),
    linear-gradient(145deg, #052e4d, #08689f 58%, var(--brand));
}

.story-watermark {
  position: absolute;
  right: 28px;
  bottom: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.05);
  font-size: 170px;
  line-height: 0.88;
  pointer-events: none;
  user-select: none;
}

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

.auth-brand .brand-title {
  white-space: normal;
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.auth-copy h1 {
  font-size: clamp(34px, 4.8vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.auth-copy p {
  max-width: 380px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  line-height: 1.75;
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.auth-badges span {
  min-height: 29px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.auth-meta {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
}

.auth-form-pane {
  display: grid;
  align-content: center;
  padding: 42px;
}

.auth-form {
  width: min(100%, 360px);
  margin: auto;
}

.auth-form h2 {
  margin-bottom: 5px;
  font-size: 27px;
  letter-spacing: -0.03em;
}

.auth-form > p {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12px;
}

.auth-fields {
  display: grid;
  gap: 12px;
}

.auth-error {
  display: none;
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 11px;
}

.auth-error.show {
  display: block;
}

@media (max-width: 960px) {
  .app {
    border-radius: 0;
    box-shadow: none;
  }

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

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .main {
    padding: 17px 14px 24px;
  }

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

  .stat.primary {
    grid-column: 1 / -1;
  }

  .dashboard-grid,
  .form-layout,
  .detail-grid,
  .contract-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-visual {
    min-height: 280px;
    padding: 27px;
  }

  .auth-copy h1 {
    margin-top: 40px;
    font-size: 34px;
  }

  .auth-form-pane {
    padding: 30px 22px;
  }
}

@media (max-width: 700px) {
  .app {
    min-height: 100vh;
  }

  .topbar {
    min-height: 62px;
    padding: 10px 12px;
  }

  .brand {
    flex: 1;
  }

  .brand-title {
    max-width: 155px;
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;
  }

  .brand-subtitle,
  .user-meta {
    display: none;
  }

  .top-actions {
    flex: 0 0 auto;
  }

  .logout-button,
  .ghost-button {
    min-width: 50px;
    padding: 0 9px;
    font-size: 10px;
  }

  .page-head {
    display: grid;
  }

  .head-actions {
    justify-content: flex-start;
  }

  .stats,
  .contract-grid {
    grid-template-columns: 1fr;
  }

  .stat.primary {
    grid-column: auto;
  }

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

  .toolbar .search-box,
  .toolbar .date-range {
    grid-column: 1 / -1;
  }

  .summary-strip,
  .page-summary {
    grid-template-columns: 1fr 1fr;
  }

  .page-summary > div:last-child {
    grid-column: 1 / -1;
  }

  .table-wrap {
    display: none;
  }

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

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

  .field.full {
    grid-column: auto;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
  }

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

  .temp-password {
    grid-template-columns: 1fr;
  }

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

  .auth-page {
    background: var(--surface);
  }

  .auth-card {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-visual {
    min-height: 235px;
    padding: 22px;
  }

  .auth-copy h1 {
    margin-top: 31px;
    font-size: 30px;
  }

  .auth-copy p {
    font-size: 12px;
  }

  .auth-meta {
    display: none;
  }

  .auth-form-pane {
    padding: 25px 16px 34px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
