:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #eeeeF2;
  --text: #1d1d1f;
  --body-text: #424245;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.16);
  --primary: #0071e3;
  --primary-strong: #005bb5;
  --success: #248a3d;
  --warning: #a05a00;
  --danger: #d70015;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 24px 70px rgba(0, 0, 0, 0.13);
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.045), 0 14px 40px rgba(0, 0, 0, 0.085);
  --glass: rgba(255, 255, 255, 0.8);
  font-synthesis-weight: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 30%, #eeeeF2 100%);
  color: var(--body-text);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

::selection {
  background: rgba(0, 113, 227, 0.18);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  background: #f5f5f7;
}

.login-shell--hero {
  position: relative;
  min-height: 100vh;
  display: block;
  overflow: hidden;
  background: #000;
}

.login-visual {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background: #eeeeF2;
}

.login-shell:not(.login-shell--hero) .login-visual {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px;
}

.visual-board {
  width: min(720px, 100%);
  display: grid;
  gap: 16px;
}

.visual-board--image {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #000;
}

.login-visual-image {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  display: block;
  object-fit: cover;
  object-position: center;
  opacity: 0.82;
  filter: saturate(0.82) contrast(1.08) brightness(0.86);
}

.login-shell--hero .login-panel {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: calc(50% - 560px);
  width: 420px;
  transform: translateY(-50%);
}

.login-panel {
  position: relative;
  z-index: 1;
  align-self: center;
  margin: 40px;
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-soft);
}

.login-shell:not(.login-shell--hero) .login-panel {
  margin: 56px;
  background: rgba(255, 255, 255, 0.86);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  background: var(--text);
}

.brand-name {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.login-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 56px;
  line-height: 1.04;
  font-weight: 600;
}

.login-copy {
  margin: 0 0 32px;
  max-width: 36ch;
  color: var(--body-text);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--body-text);
  font-size: 14px;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(251, 251, 253, 0.84);
  color: var(--text);
  padding: 11px 14px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #86868b;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(0, 113, 227, 0.72);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

.role-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
}

.role-toggle button {
  border: 0;
  border-radius: 999px;
  min-height: 38px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.role-toggle button.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 44px;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.primary-btn {
  color: #fff;
  background: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.18);
}

.secondary-btn {
  color: var(--primary);
  background: rgba(0, 113, 227, 0.08);
  border-color: transparent;
}

.secondary-btn:hover {
  background: rgba(0, 113, 227, 0.14);
  transform: translateY(-1px);
}

.ghost-btn {
  color: var(--text);
  background: rgba(251, 251, 253, 0.78);
  border-color: var(--line);
}

.ghost-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.danger-btn {
  color: #fff;
  background: var(--danger);
}

.mini-card,
.login-chart {
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-subtle);
}

.mini-card {
  padding: 32px;
}

.mini-label {
  color: var(--muted);
  font-size: 14px;
}

.mini-value {
  margin-top: 10px;
  color: var(--text);
  font-size: 42px;
  line-height: 1.08;
  font-weight: 600;
}

.mini-foot {
  margin-top: 12px;
  color: var(--primary);
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 42%, #eeeeF2 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 56px;
  padding: 0 max(24px, calc((100vw - 1200px) / 2));
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 18px rgba(0, 0, 0, 0.045);
}

.sidebar .login-brand {
  flex: 0 0 auto;
  margin: 0;
}

.sidebar .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 11px;
}

.sidebar .brand-name {
  font-size: 14px;
}

.sidebar .brand-subtitle {
  display: none;
}

.nav-list {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-list button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #424245;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-list button.active,
.nav-list button:hover {
  background: rgba(0, 0, 0, 0.075);
  color: var(--text);
}

.nav-list button:hover {
  transform: translateY(-1px);
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 360px;
  padding: 72px max(24px, calc((100vw - 1200px) / 2)) 116px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 32px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 58%, #eeeeF2 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.page-title {
  margin: 0;
  max-width: 860px;
  color: var(--text);
  font-size: 64px;
  line-height: 1.04;
  font-weight: 600;
}

.page-kicker {
  margin: 16px 0 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.38;
  font-weight: 400;
}

.user-area {
  min-height: 48px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.095);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-area strong {
  padding-right: 4px;
  font-size: 14px;
  font-weight: 500;
}

.user-area .ghost-btn {
  min-height: 36px;
  padding: 7px 14px;
  background: rgba(251, 251, 253, 0.9);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 113, 227, 0.1);
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
}

.content {
  width: min(1200px, calc(100% - 48px));
  margin: -72px auto 72px;
  display: grid;
  gap: 24px;
  align-content: start;
}

.content > * {
  min-width: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 200px));
  gap: 14px;
  justify-content: start;
}

.metric-card,
.panel,
.workflow-card,
.record-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow-subtle);
}

.metric-card {
  min-height: 126px;
  padding: 20px;
  border-radius: 17px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.metric-card:hover,
.workflow-card:hover,
.record-card:hover,
.panel:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.12);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--body-text);
  font-size: 11px;
  font-weight: 400;
}

.metric-value {
  margin-top: 13px;
  color: var(--text);
  font-size: 31px;
  line-height: 1.05;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.metric-note {
  margin-top: 8px;
  color: var(--body-text);
  font-size: 10px;
  line-height: 1.45;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 24px;
  align-items: start;
}

.panel {
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.panel-header {
  min-height: 78px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.18;
  font-weight: 600;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--body-text);
  font-size: 15px;
  line-height: 1.45;
}

.panel-body {
  padding: 0 28px 28px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  line-height: 1.45;
}

th {
  color: var(--muted);
  font-weight: 500;
  background: transparent;
}

td strong {
  color: var(--text);
  font-weight: 600;
}

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

tbody tr:hover {
  background: rgba(0, 0, 0, 0.025);
}

.status,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status.success {
  color: var(--success);
  background: rgba(36, 138, 61, 0.1);
}

.status.warning {
  color: var(--warning);
  background: rgba(160, 90, 0, 0.1);
}

.status.neutral {
  color: #424245;
  background: rgba(0, 0, 0, 0.06);
}

.status.danger {
  color: var(--danger);
  background: rgba(215, 0, 21, 0.1);
}

.tag {
  color: var(--primary);
  background: rgba(0, 113, 227, 0.1);
}

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

.mini-btn {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(251, 251, 253, 0.88);
  color: var(--body-text);
  font-size: 13px;
  font-weight: 500;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.mini-btn:hover {
  transform: translateY(-1px);
  background: #fff;
}

.mini-btn.primary {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}

.mini-btn.danger {
  border-color: transparent;
  background: rgba(215, 0, 21, 0.1);
  color: var(--danger);
}

.link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  white-space: normal;
  text-align: left;
}

.link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.split-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

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

.upload-box {
  min-height: 96px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.file-upload {
  position: relative;
}

.file-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  left: 0;
  bottom: 0;
}

.file-btn {
  min-height: 40px;
  border-radius: 999px;
  padding: 8px 16px;
  border: 0;
  color: #fff;
  background: var(--primary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.file-name {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.workflow-list {
  display: grid;
  gap: 18px;
}

.milestone-list {
  grid-template-columns: repeat(auto-fit, minmax(210px, 240px));
  justify-content: start;
}

.workflow-card {
  padding: 24px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.milestone-card {
  cursor: pointer;
  min-height: 212px;
  padding: 18px;
  border-radius: 17px;
}

.milestone-card:hover {
  border-color: rgba(0, 113, 227, 0.26);
}

.milestone-card--active {
  border-color: rgba(0, 113, 227, 0.48);
  background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
  box-shadow: 0 20px 50px rgba(0, 113, 227, 0.14);
}

.milestone-card--danger {
  border-color: rgba(215, 0, 21, 0.28);
}

.milestone-card:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.24);
  outline-offset: 2px;
}

.milestone-card .workflow-meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.42;
}

.milestone-card .workflow-head {
  gap: 10px;
}

.milestone-card .workflow-title {
  font-size: 15px;
  line-height: 1.22;
}

.milestone-card .tag,
.milestone-card .status {
  min-height: 20px;
  padding: 3px 8px;
  font-size: 10px;
}

.milestone-card .progress-track {
  height: 6px;
}

.milestone-card .compact-note {
  font-size: 11px;
  line-height: 1.45;
}

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

.workflow-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.24;
  font-weight: 600;
}

.workflow-meta {
  margin-top: 6px;
  color: var(--body-text);
  font-size: 14px;
  line-height: 1.5;
}

.stepper {
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.step {
  min-height: 86px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 14px;
  background: #f5f5f7;
}

.step.done {
  border-color: rgba(36, 138, 61, 0.18);
  background: rgba(36, 138, 61, 0.06);
}

.step.current {
  border-color: rgba(0, 113, 227, 0.28);
  background: rgba(0, 113, 227, 0.08);
}

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

.step-name {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.record-list {
  display: grid;
  gap: 14px;
}

.record-card {
  padding: 20px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.record-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.record-meta {
  margin-top: 6px;
  color: var(--body-text);
  font-size: 13px;
}

.record-values {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.record-values div {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #f5f5f7;
}

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

.record-values strong {
  display: block;
  margin-top: 4px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: start;
}

.timeline-date {
  color: var(--muted);
  font-size: 13px;
}

.timeline-body {
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f5f5f7;
}

.timeline-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.timeline-desc {
  margin: 6px 0 0;
  color: var(--body-text);
  font-size: 14px;
  line-height: 1.5;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.notice {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #fff7e3;
  color: #7a4f00;
  border: 1px solid rgba(160, 90, 0, 0.18);
  font-size: 14px;
  line-height: 1.65;
}

.notice-sheet {
  margin: 18px 0;
  padding: 20px;
  border-radius: var(--radius-md);
  background: #f5f5f7;
  display: grid;
  gap: 14px;
}

.notice-sheet p {
  margin: 0;
  color: var(--body-text);
  line-height: 1.75;
}

.account-password-form {
  max-width: 560px;
  margin-top: 18px;
}

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  background: #f5f5f7;
  border-radius: var(--radius-lg);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.modal {
  width: min(760px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-lg);
  background: rgba(251, 251, 253, 0.92);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
}

.modal-header {
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 600;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  transition:
    transform 160ms ease,
    background-color 160ms ease;
}

.icon-btn:hover {
  transform: scale(1.04);
  background: #fff;
}

.modal-body {
  padding: 0 32px 32px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  font-weight: 500;
}

.signature-field {
  display: grid;
  gap: 10px;
}

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

.signature-head .field-label {
  margin-bottom: 0;
}

.signature-canvas {
  width: 100%;
  height: 160px;
  display: block;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: #fbfbfd;
  touch-action: none;
}

.signature-thumb {
  width: 96px;
  height: 36px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 2px 6px;
}

.exit-signature-thumb {
  width: 136px;
  height: 48px;
}

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

.detail-grid > div,
.attachment-list > div {
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f5f5f7;
}

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

.detail-grid strong,
.attachment-list strong {
  display: block;
  font-weight: 500;
}

.detail-section {
  margin-top: 24px;
}

.detail-section h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
}

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

.attachment-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: #f5f5f7;
  margin-bottom: 16px;
}

.attachment-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.attachment-preview h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.attachment-preview p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.attachment-viewer {
  height: min(62vh, 620px);
  min-height: 360px;
  border-radius: var(--radius-lg);
  background: #eeeeF2;
  overflow: hidden;
}

.attachment-viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.attachment-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.compact-note {
  color: var(--body-text);
  font-size: 13px;
  line-height: 1.55;
}

.mobile-menu {
  display: none;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 200px));
  }

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

  .page-title {
    font-size: 56px;
  }
}

@media (max-width: 820px) {
  .login-shell,
  .app-shell {
    display: block;
  }

  .login-shell:not(.login-shell--hero) .login-panel {
    margin: 24px;
  }

  .login-shell--hero {
    display: grid;
    align-items: end;
    min-height: 100vh;
  }

  .login-shell--hero .login-panel {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    margin: 24px;
    transform: none;
  }

  .login-title {
    font-size: 40px;
  }

  .login-copy {
    font-size: 16px;
  }

  .sidebar {
    min-height: auto;
    padding: 10px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .sidebar .login-brand {
    width: 100%;
  }

  .nav-list {
    justify-content: flex-start;
    width: 100%;
  }

  .nav-list button {
    min-height: 34px;
    padding: 0 10px;
  }

  .topbar {
    min-height: 300px;
    padding: 48px 20px 96px;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .page-title {
    font-size: 40px;
  }

  .page-kicker {
    font-size: 17px;
  }

  .user-area {
    width: 100%;
    justify-content: space-between;
  }

  .content {
    width: calc(100% - 32px);
    margin-top: -64px;
    margin-bottom: 40px;
    gap: 18px;
  }

  .panel-header,
  .workflow-head,
  .record-top,
  .signature-head,
  .attachment-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-header .actions,
  .record-top > div,
  .attachment-preview > div {
    width: 100%;
  }

  .panel-header,
  .panel-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .form-grid,
  .detail-grid,
  .attachment-list {
    grid-template-columns: 1fr;
  }

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

  .metric-card {
    min-height: 126px;
  }

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

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .table-wrap {
    overflow: visible;
  }

  table.responsive-table {
    min-width: 0;
  }

  table.responsive-table thead {
    display: none;
  }

  table.responsive-table,
  table.responsive-table tbody,
  table.responsive-table tr,
  table.responsive-table td {
    display: block;
    width: 100%;
  }

  table.responsive-table tbody {
    display: grid;
    gap: 14px;
  }

  table.responsive-table tr {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-subtle);
  }

  table.responsive-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  table.responsive-table td:last-child {
    border-bottom: 0;
  }

  table.responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
  }

  table.responsive-table td .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  table.responsive-table td .mini-btn,
  table.responsive-table td .primary-btn,
  table.responsive-table td .secondary-btn,
  table.responsive-table td .ghost-btn,
  table.responsive-table td .danger-btn {
    width: 100%;
  }

  .modal-backdrop {
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .modal-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .modal-header h2 {
    font-size: 28px;
  }

  .modal-body {
    padding: 0 20px 24px;
  }

  .attachment-viewer {
    height: min(46vh, 420px);
    min-height: 240px;
  }

  .signature-canvas {
    height: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
