:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d9e1e8;
  --brand: #176b5b;
  --brand-dark: #0d473d;
  --accent: #c77d2b;
  --accent-soft: #fff3e4;
  --success: #1f8a5b;
  --shadow: 0 16px 40px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.footer-inner,
.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  width: 100%;
  margin: 0;
  padding: 0 40px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 60px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.brand-copy {
  display: grid;
  align-content: center;
  gap: 4px;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  flex: 0 1 auto;
  min-width: 0;
}

.main-nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--brand-dark);
  background: #e6f3ef;
}

.user-menu {
  position: relative;
  flex: 0 0 auto;
}

.user-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.current-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.user-name {
  overflow: hidden;
  max-width: 100px;
  text-overflow: ellipsis;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
  display: grid;
  gap: 4px;
  width: 150px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(31, 41, 51, 0.14);
}

.user-menu-panel a,
.user-menu-panel button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
  color: var(--brand-dark);
  background: #e6f3ef;
}

.login-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(23, 107, 91, 0.08), rgba(199, 125, 43, 0.08)),
    var(--bg);
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
}

.login-card {
  width: min(520px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 28px;
}

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

.login-heading h1 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.1;
}

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

.login-form label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 700;
}

.login-form input,
.login-form select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  background: #ffffff;
}

.login-form input:focus,
.login-form select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(23, 107, 91, 0.12);
}

.login-form select:disabled {
  color: var(--muted);
  background: #f4f6f8;
}

.login-form .button {
  justify-content: center;
  margin-top: 4px;
}

.login-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff3e4;
  color: #9a4f12;
  font-weight: 700;
}

.page-shell {
  display: flow-root;
  flex: 1;
  width: 100%;
  padding: 14px 40px 40px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 32px;
  align-items: stretch;
  padding: 42px;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(110deg, rgba(13, 71, 61, 0.96), rgba(23, 107, 91, 0.86)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520' viewBox='0 0 900 520'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.16' stroke-width='2'%3E%3Cpath d='M80 420h760M145 420V190h230v230M420 420V120h330v300M180 220h160M180 270h160M180 320h160M460 160h250M460 215h250M460 270h250M460 325h250M460 380h250'/%3E%3Cpath d='M70 420l150-300 120 180 110-220 170 340'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.hero-panel h1,
.page-title h1,
.section-heading h2,
.split-layout h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero-panel h1 {
  max-width: 720px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
}

.hero-copy {
  max-width: 650px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-panel .eyebrow {
  color: #ffd9ab;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 700;
}

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

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.button.solid {
  border: 0;
  color: #ffffff;
  background: var(--brand);
}

.button.ghost {
  border: 1px solid var(--line);
  color: var(--brand-dark);
  background: #ffffff;
}

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

.hero-metrics article,
.stat-card,
.project-card,
.section-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.hero-metrics article {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 138px;
  padding: 20px;
  color: var(--ink);
}

.hero-metrics span,
.stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.hero-metrics strong,
.stat-card strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--brand-dark);
  font-size: 32px;
  line-height: 1;
}

.hero-metrics small,
.stat-card small {
  color: var(--muted);
  line-height: 1.5;
}

.section-block {
  margin-top: 12px;
}

.page-title {
  margin-top: 0;
  padding: 0;
}

.page-title .eyebrow {
  margin-bottom: 4px;
}

.compact-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-title h1 {
  font-size: 26px;
  line-height: 1.18;
}

.page-title p:last-child {
  max-width: 760px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  padding: 22px;
}

.section-block {
  padding: 18px 22px;
}

.empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.contract-list-heading {
  align-items: flex-start;
}

.contract-heading-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.contract-heading-tools .badge {
  align-self: flex-end;
}

.embedded-heading {
  margin-top: 24px;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-upload-form {
  margin: 0;
}

.inline-upload-form label {
  cursor: pointer;
}

.section-heading h2,
.split-layout h2 {
  font-size: 28px;
}

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

.project-card {
  padding: 22px;
}

.card-topline,
.card-bottomline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.card-topline strong {
  color: var(--success);
}

.project-card h3 {
  margin: 14px 0 10px;
  font-size: 20px;
}

.project-card p,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.progress {
  height: 8px;
  margin: 18px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef2;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.split-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
}

.module-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.module-card {
  display: grid;
  gap: 12px;
  min-height: 180px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(25, 43, 56, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 107, 91, 0.38);
  box-shadow: 0 22px 52px rgba(25, 43, 56, 0.1);
}

.module-card span {
  color: var(--accent);
  font-weight: 800;
}

.module-card strong {
  color: var(--ink);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.15;
}

.module-card p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.certificate-chart {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.certificate-pie {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 999px;
  background: conic-gradient(var(--pie-gradient));
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.certificate-pie::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: inherit;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(204, 216, 225, 0.72);
}

.certificate-pie-total {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  line-height: 1;
  transform: translateY(1px);
}

.certificate-pie b {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.certificate-pie small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.certificate-chart-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 9px;
  max-height: 190px;
  min-width: 0;
  overflow: auto;
  padding-right: 4px;
}

.certificate-chart-legend-three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.certificate-chart-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) minmax(64px, auto);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.certificate-chart-row i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--segment-color);
}

.certificate-chart-row span {
  overflow: hidden;
  color: var(--segment-color);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-chart-row strong {
  display: inline-flex;
  gap: 2px;
  justify-content: flex-end;
  align-items: baseline;
  color: var(--ink);
  font-size: 14px;
}

.certificate-chart-row strong em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.identity-tool-shell {
  display: grid;
  gap: 18px;
}

.identity-upload-zone {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  width: 100%;
  min-height: 220px;
  padding: 30px 36px;
  border: 1.5px dashed rgba(23, 107, 91, 0.28);
  border-radius: 8px;
  color: var(--brand-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 249, 0.95)),
    radial-gradient(circle at 50% 42%, rgba(23, 107, 91, 0.1), transparent 46%);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(217, 225, 232, 0.42);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.identity-upload-zone:hover,
.identity-upload-zone.is-dragging {
  border-color: rgba(23, 107, 91, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(23, 107, 91, 0.1),
    0 12px 26px rgba(23, 107, 91, 0.08);
  transform: translateY(-1px);
}

.identity-upload-zone[hidden] {
  display: none;
}

.identity-upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.identity-upload-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(23, 107, 91, 0.22);
  border-radius: 50%;
  color: var(--brand);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.08), 0 0 0 0 rgba(23, 107, 91, 0.18);
  animation: identity-upload-breathe 2.4s ease-in-out infinite;
}

.identity-upload-icon svg {
  width: 28px;
  height: 28px;
}

.identity-upload-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.identity-upload-copy {
  display: grid;
  gap: 5px;
  text-align: center;
}

.identity-upload-copy strong {
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1.25;
}

.identity-upload-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@keyframes identity-upload-breathe {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 10px 24px rgba(31, 41, 51, 0.08), 0 0 0 0 rgba(23, 107, 91, 0.18);
  }

  50% {
    transform: scale(1.045);
    box-shadow: 0 12px 26px rgba(31, 41, 51, 0.1), 0 0 0 10px rgba(23, 107, 91, 0);
  }
}

.identity-tool-workspace {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 18px;
  align-items: start;
}

.identity-source-panel,
.identity-result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.identity-panel-heading strong {
  color: var(--ink);
}

.identity-panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.identity-source-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.identity-source-reset {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: inherit;
}

.identity-source-reset:disabled {
  color: rgba(104, 116, 138, 0.45);
  cursor: not-allowed;
  background: #f3f6f8;
}

.identity-result-heading-actions {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) 34px 34px;
  align-items: center;
  justify-content: end;
  gap: 10px;
  margin-left: auto;
}

.identity-result-heading-actions span {
  text-align: right;
}

.identity-result-copy-button,
.identity-result-download-button {
  justify-self: end;
}

.identity-source-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 10px 28px;
  border: 2px solid transparent;
  background: #ffffff;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.identity-source-preview.has-image {
  cursor: pointer;
}

.identity-source-preview.is-dragging {
  border-color: rgba(23, 107, 91, 0.58);
  background-color: rgba(23, 107, 91, 0.08);
}

.identity-source-preview img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  border-radius: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.identity-source-preview img[hidden] {
  display: none;
}

.identity-source-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.12);
  transform: translateX(-50%);
}

.identity-source-dots[hidden] {
  display: none;
}

.identity-source-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(102, 112, 133, 0.38);
  cursor: pointer;
}

.identity-source-dot.active {
  width: 22px;
  border-radius: 999px;
  background: var(--brand);
}

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

.identity-results-list[hidden] {
  display: none;
}

.identity-result-batch {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.identity-result-batch-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.identity-result-batch-heading > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.identity-result-batch-heading strong {
  color: var(--ink);
  font-size: 16px;
}

.identity-result-batch-heading span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-tool-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.identity-tool-actions button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.identity-tool-actions .button.ghost {
  border: 1px solid var(--line);
}

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

.identity-result-canvas-wrap {
  padding: 0;
  background: #f7faf9;
}

.identity-result-canvas-wrap canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  border-radius: 0;
  background: #ffffff;
}

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

.status-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.status-row strong {
  color: var(--brand-dark);
}

.status-row small,
.badge {
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--brand-dark);
  background: #e6f3ef;
  font-weight: 700;
}

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

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

.certificate-table {
  min-width: 1040px;
}

.employee-table {
  min-width: 1040px;
}

.contract-table {
  min-width: 1600px;
}

th,
td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: #f8fafb;
}

td {
  font-size: 15px;
}

tbody tr {
  transition: background-color 0.16s ease;
}

tbody tr:hover {
  background: #eef7f4;
}

.certificate-table th,
.certificate-table td {
  white-space: normal;
  vertical-align: middle;
}

.certificate-table .col-compact,
.certificate-table .col-date,
.certificate-table .col-actions {
  width: 1%;
  white-space: nowrap;
}

.certificate-table .col-number {
  width: 1%;
  min-width: 148px;
  white-space: nowrap;
}

.certificate-table .col-wide {
  min-width: 170px;
}

.employee-table .col-fit {
  width: 1%;
  white-space: nowrap;
}

.employee-table .row-actions,
.certificate-table .row-actions {
  text-align: center;
  vertical-align: middle;
}

.certificate-table .col-actions {
  min-width: 126px;
}

.contract-project-name {
  width: 100%;
  min-width: 560px;
  max-width: none;
  white-space: normal;
  line-height: 1.5;
}

.contract-table td.contract-row-actions,
.contract-table th:last-child {
  min-width: 96px;
  text-align: center;
}

.contract-table th:not(:nth-child(2)),
.contract-table td:not(:nth-child(2)) {
  width: 1%;
  white-space: nowrap;
}

.contract-compact-text {
  max-width: 140px;
  white-space: normal;
  line-height: 1.45;
}

.contract-employer-name {
  max-width: 220px;
  white-space: normal;
  line-height: 1.45;
}

.contract-period-range {
  white-space: nowrap;
}

.contract-copy-text {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: copy;
}

.contract-copy-text:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contract-copy-text.copied {
  color: var(--brand-dark);
}

.contract-completion-cell {
  text-align: center;
}

.contract-completion-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  font-size: 16px;
  line-height: 1;
}

.contract-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid #d5dce3;
  border-radius: 999px;
  color: #475467;
  background: #f2f4f7;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.contract-tag-construction {
  border-color: #b9dfd5;
  color: #0d5f50;
  background: #e5f5f1;
}

.contract-tag-design {
  border-color: #bdd7ff;
  color: #184f90;
  background: #e9f2ff;
}

.contract-tag-self {
  border-color: #c3d8ff;
  color: #1d4f91;
  background: #eef5ff;
}

.contract-tag-joint {
  border-color: #f3cf9d;
  color: #8a4b12;
  background: #fff4e5;
}

.contract-tag-archived {
  border-color: #b9dfd5;
  color: #137156;
  background: #e8f6ef;
}

.contract-tag-pending {
  border-color: #f0d38d;
  color: #8a5a00;
  background: #fff7da;
}

.contract-tag-void {
  border-color: #f2b8b5;
  color: #a33b36;
  background: #fff0ef;
}

.employee-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 11px;
  border: 1px solid #d5dce3;
  border-radius: 999px;
  color: #475467;
  background: #f2f4f7;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.employee-type-internal {
  border-color: #b9dfd5;
  color: #0d5f50;
  background: #e5f5f1;
}

.employee-type-external {
  border-color: #f3cf9d;
  color: #8a4b12;
  background: #fff4e5;
}

.employee-type-family_member {
  border-color: #d3c8fb;
  color: #5a3c9d;
  background: #f4f0ff;
}

.employee-type-unknown,
.employee-status-unknown {
  border-color: #d5dce3;
  color: #667085;
  background: #f2f4f7;
}

.employee-status-active {
  border-color: #b9dfd5;
  color: #137156;
  background: #e8f6ef;
}

.employee-status-probation {
  border-color: #f0d38d;
  color: #8a5a00;
  background: #fff7da;
}

.employee-status-inactive {
  border-color: #d0d5dd;
  color: #5b6472;
  background: #eef1f4;
}

.contract-year-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.contract-year-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475467;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.contract-year-tabs a:hover,
.contract-year-tabs a.active {
  border-color: rgba(23, 107, 91, 0.32);
  color: var(--brand-dark);
  background: #e6f3ef;
}

.table-link {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(13, 71, 61, 0.22);
  text-underline-offset: 3px;
}

.table-link:hover {
  color: var(--brand);
  text-decoration-color: currentColor;
}

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

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

.search-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px auto;
  gap: 16px;
  align-items: start;
}

.certificate-search-bar {
  grid-template-columns: minmax(260px, 1fr) 180px auto;
}

.contract-search-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.contract-search-bar label {
  flex: 0 0 128px;
  white-space: nowrap;
}

.contract-search-bar label:first-of-type {
  flex: 1 1 auto;
  min-width: 240px;
}

.contract-search-bar label:has(select[name="professional_category"]),
.contract-search-bar label:has(select[name="industry_category"]) {
  flex-basis: 148px;
}

.contract-search-bar .form-actions {
  margin-left: auto;
  align-self: stretch;
  align-items: end;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  white-space: nowrap;
}

.filter-tabs {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  padding: 4px;
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f8fa;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.filter-tabs::-webkit-scrollbar {
  height: 8px;
}

.filter-tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c9d4dd;
}

.filter-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.filter-tab-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  z-index: 0;
  height: calc(100% - 8px);
  border-radius: 5px;
  background: var(--brand);
  box-shadow: 0 6px 16px rgba(23, 107, 91, 0.2);
  transition: transform 0.22s ease, width 0.22s ease;
}

.filter-tabs.is-positioning .filter-tab-indicator {
  transition: none;
}

.filter-tabs a {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 32px;
  padding: 0 16px;
  border-radius: 5px;
  color: #516073;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  transition: color 0.18s ease;
}

.filter-tab-group-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-left: 8px;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  color: #9a5b00;
  font-size: 13px;
  font-weight: 900;
}

.filter-tabs a.eight-member-tab {
  color: #7a4c13;
  border-color: rgba(199, 125, 43, 0.14);
  background: rgba(199, 125, 43, 0.08);
}

.filter-tabs a:hover,
.filter-tabs a.active {
  color: var(--brand-dark);
}

.filter-tabs a.eight-member-tab:hover,
.filter-tabs a.eight-member-tab.active {
  color: #7a4c13;
}

.filter-tabs a.is-indicator-target {
  color: #ffffff;
  background: transparent;
}

.filter-tabs a.eight-member-tab.is-indicator-target {
  color: #ffffff;
}

.certificate-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.certificate-status-valid {
  border-color: #b8e1d0;
  color: #0d6b4f;
  background: #e7f6ef;
}

.certificate-status-expiring {
  border-color: #f6d08b;
  color: #9a5b00;
  background: #fff4d8;
}

.certificate-status-expired {
  border-color: #f0a8a8;
  color: #b42318;
  background: #fff0f0;
}

.certificate-status-revoked {
  border-color: #a9b0ba;
  color: #344054;
  background: #eef1f4;
}

.certificate-status-勿用 {
  border-color: #f0a8a8;
  color: #b42318;
  background: #fff0f0;
}

.certificate-status-unknown {
  border-color: var(--line);
  color: var(--muted);
  background: #f6f8fa;
}

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

.certificate-image-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.certificate-image-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.certificate-image-frame {
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.certificate-image-frame.has-image {
  background: #ffffff;
}

.certificate-image-frame img {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
}

.personal-certificate-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.personal-certificate-image-panel {
  margin-top: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.05);
}

.personal-certificate-image-panel .certificate-image-frame {
  min-height: 520px;
  border-color: #dbe5ed;
  background: #f8fafb;
}

.personal-certificate-image-panel .certificate-image-frame img {
  max-height: 680px;
}

.certificate-detail-data {
  min-width: 0;
}

.certificate-copy-fallback-input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

.certificate-upload-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.certificate-dropzone {
  display: block;
  position: relative;
  cursor: pointer;
}

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

.certificate-upload-preview {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed rgba(104, 116, 138, 0.32);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.certificate-dropzone:hover .certificate-upload-preview,
.certificate-dropzone.is-dragging .certificate-upload-preview {
  border-color: rgba(18, 112, 92, 0.48);
  background: rgba(18, 112, 92, 0.06);
  box-shadow: 0 0 0 3px rgba(18, 112, 92, 0.08);
}

.certificate-upload-preview.has-image {
  background: #fbfcfd;
}

.certificate-upload-preview img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.certificate-upload-preview img[hidden] {
  display: none;
}

.company-certificate-upload-section {
  margin-top: 0;
}

.company-certificate-upload-grid,
.company-certificate-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.company-certificate-upload-grid .certificate-upload-preview {
  min-height: 180px;
}

.company-certificate-upload-grid .certificate-upload-preview img {
  max-height: 240px;
}

.company-certificate-image-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.company-certificate-image-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.company-certificate-image-card-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.company-certificate-image-frame {
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border: 1px dashed rgba(104, 116, 138, 0.32);
  border-radius: 6px;
  background: #ffffff;
}

.company-certificate-image-frame.has-image {
  border-style: solid;
}

.company-certificate-image-frame img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.contract-pagination-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
}

.contract-pagination-center {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
}

.contract-pagination-bar .pagination-summary {
  justify-self: start;
}

.contract-pagination-bar .page-buttons {
  grid-column: 3;
  justify-self: end;
  margin-left: 0;
}

.contract-pagination-bar,
.contract-pagination-bar .button,
.contract-pagination-bar label,
.contract-pagination-bar input,
.contract-pagination-bar select {
  font-size: 13px;
}

.contract-pagination-bar .button {
  min-height: 38px;
  padding: 0 14px;
  line-height: 1;
}

.pagination-actions,
.page-buttons,
.page-size-form,
.page-jump-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-actions {
  flex: 1 1 520px;
  justify-content: flex-end;
}

.page-buttons {
  margin-left: auto;
  justify-content: flex-end;
}

.page-size-form,
.page-jump-form {
  min-height: 42px;
}

.page-size-form label,
.page-jump-form label {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.page-size-form select,
.page-jump-form input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-weight: 800;
}

.page-size-form select {
  min-width: 78px;
  padding: 0 28px 0 12px;
}

.page-jump-form input {
  width: 74px;
  padding: 0 10px;
}

.button.disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.record-form label,
.search-bar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.record-form input,
.record-form select,
.record-form textarea,
.search-bar input,
.search-bar select {
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
}

.record-form input,
.record-form select,
.search-bar input,
.search-bar select {
  height: 48px;
}

.record-form textarea {
  min-height: 116px;
  padding-top: 12px;
  padding-bottom: 12px;
  line-height: 1.5;
  resize: vertical;
}

.record-form .checkbox-field {
  align-items: center;
  grid-template-columns: 22px 1fr;
  min-height: 48px;
}

.record-form .checkbox-field input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--brand);
}

.record-form .checkbox-field span {
  color: var(--ink);
  font-weight: 800;
}

.record-form select,
.search-bar select {
  appearance: none;
  padding-right: 40px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 18px 18px;
}

.record-form input:focus,
.record-form select:focus,
.record-form textarea:focus,
.search-bar input:focus,
.search-bar select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
  outline: none;
}

.clearable-input {
  position: relative;
}

.clearable-input input {
  padding-right: 44px;
}

.clear-input-button {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: #eef3f6;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.clear-input-button:hover {
  color: var(--brand-dark);
  background: #dceee9;
}

.clear-input-button[hidden] {
  display: none;
}

.search-bar .button {
  min-height: 48px;
}

.search-bar .form-actions {
  align-self: end;
}

.search-bar.contract-search-bar .form-actions {
  align-self: stretch;
  align-items: end;
  flex-wrap: nowrap;
  min-width: 0;
  white-space: nowrap;
}

.contract-filter-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-dark);
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.contract-filter-icon-button:hover {
  border-color: rgba(23, 107, 91, 0.34);
  color: var(--brand);
  background: #e6f3ef;
}

.contract-filter-icon-search {
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.contract-filter-icon-search:hover {
  border-color: var(--brand-dark);
  color: #ffffff;
  background: var(--brand-dark);
}

.contract-filter-icon-button svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contract-filter-icon-button svg * {
  vector-effect: non-scaling-stroke;
}

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

.form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.form-actions button {
  cursor: pointer;
}

.title-inline-form {
  display: inline-flex;
  margin: 0;
}

.title-inline-form button {
  cursor: pointer;
}

.row-actions {
  white-space: nowrap;
}

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

.row-actions a,
.row-actions button {
  border: 0;
  padding: 0;
  color: var(--brand-dark);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.contract-row-actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.contract-row-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contract-row-actions form {
  display: inline-flex;
  margin: 0;
}

.row-actions form {
  display: inline-flex;
  margin: 0;
}

.row-actions .icon-action {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-dark);
  background: #ffffff;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.row-actions .icon-action:hover {
  border-color: rgba(23, 107, 91, 0.34);
  color: var(--brand);
  background: #e6f3ef;
}

.row-actions .icon-action-danger {
  color: #a33b36;
}

.row-actions .icon-action-danger:hover {
  border-color: #f2b8b5;
  color: #8f1f1a;
  background: #fff0ef;
}

.icon-action svg {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  max-height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action svg * {
  vector-effect: non-scaling-stroke;
}

.alert-block {
  border-color: #f4c7c3;
  background: #fff8f7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.contract-modal-panel {
  width: min(1080px, 100%);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.modal-header h2 {
  margin: 0;
  font-size: 26px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.modal-form {
  padding: 24px 28px 28px;
}

.form-error {
  padding: 10px 12px;
  border: 1px solid #f2b8b5;
  border-radius: 6px;
  color: #8f1f1a;
  background: #fff0ef;
  font-weight: 700;
}

.form-section-label {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
}

.modal-actions button {
  cursor: pointer;
}

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

.detail-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.detail-grid dt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-field-links {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  white-space: nowrap;
}

.detail-field-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-dark);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.detail-field-links a:hover {
  border-color: rgba(23, 107, 91, 0.34);
  color: var(--brand);
  background: #e6f3ef;
}

.detail-grid dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  word-break: break-word;
}

.employee-heading-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.employee-detail-status-tags {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  align-self: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.employee-avatar-frame {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 74px;
  height: 96px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.employee-avatar-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.employee-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: start;
}

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

.employee-education-cell {
  position: relative;
  display: block;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.employee-education-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.employee-education-cell dt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.employee-education-cell dd {
  display: flex;
  align-items: flex-start;
  min-height: 0;
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  word-break: break-word;
}

.employee-education-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.employee-education-cell .employee-education-copy-button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.employee-education-copy-button svg {
  width: 16px;
  height: 16px;
}

.employee-education-copy-status {
  min-height: 15px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
}

.employee-insurance-panel,
.employee-certificate-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.identity-card-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.identity-card-heading {
  margin-bottom: 14px;
}

.identity-card-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

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

.identity-card-photo {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.identity-card-photo-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.identity-card-photo-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.identity-card-copy-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  justify-content: normal;
}

.identity-card-copy-header h4 {
  justify-self: start;
  min-width: 2em;
  text-align: left;
}

.identity-card-copy-header .identity-card-copy-button {
  justify-self: end;
}

.identity-card-upload-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  justify-content: normal;
}

.identity-card-upload-header h4 {
  justify-self: start;
  text-align: left;
}

.identity-card-upload-header .identity-card-edit-button {
  justify-self: end;
}

.identity-card-copy-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  cursor: pointer;
}

.identity-card-copy-button:hover {
  border-color: rgba(18, 112, 92, 0.32);
  background: rgba(18, 112, 92, 0.08);
}

.identity-card-copy-button:disabled {
  color: rgba(104, 116, 138, 0.45);
  cursor: not-allowed;
  background: #f3f6f8;
}

.identity-card-copy-button svg {
  width: 18px;
  height: 18px;
}

.identity-card-copy-button svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.identity-card-image-wrap {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(104, 116, 138, 0.32);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.identity-card-image-wrap img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.identity-card-copy-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.identity-card-upload-section {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.identity-card-upload-section .identity-card-heading {
  align-items: center;
}

.identity-card-dropzone {
  display: block;
  position: relative;
  cursor: pointer;
}

.identity-card-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.identity-card-dropzone .identity-card-image-wrap {
  min-height: 180px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.identity-card-upload-card:hover .identity-card-image-wrap,
.identity-card-upload-card.is-dragging .identity-card-image-wrap {
  border-color: rgba(18, 112, 92, 0.48);
  background: rgba(18, 112, 92, 0.06);
  box-shadow: 0 0 0 3px rgba(18, 112, 92, 0.08);
}

.identity-card-upload-card .muted {
  text-align: center;
}

.avatar-upload-section {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.employee-modal-profile {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.employee-modal-primary-fields {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.employee-modal-avatar .avatar-upload-preview {
  min-height: 100%;
  height: 148px;
  border: 0;
  background: #f8fafb;
}

.employee-modal-avatar .avatar-upload-preview img {
  width: 118px;
  max-height: 136px;
}

.avatar-dropzone {
  display: block;
  cursor: pointer;
}

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

.avatar-upload-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed rgba(104, 116, 138, 0.32);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.avatar-dropzone:hover .avatar-upload-preview,
.avatar-dropzone.is-dragging .avatar-upload-preview {
  border-color: rgba(18, 112, 92, 0.48);
  background: rgba(18, 112, 92, 0.06);
  box-shadow: 0 0 0 3px rgba(18, 112, 92, 0.08);
}

.avatar-upload-preview img {
  display: block;
  width: 160px;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.avatar-upload-preview img[hidden],
.identity-card-image-wrap img[hidden] {
  display: none;
}

.media-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.42);
}

.media-editor-backdrop[open] {
  display: flex;
}

.media-editor-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.media-editor-header {
  border-bottom: 1px solid var(--line);
}

.media-editor-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  padding: 20px 24px;
}

.media-editor-canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.media-editor-canvas {
  width: 100%;
  max-width: 640px;
  height: auto;
  cursor: default;
  touch-action: none;
  user-select: none;
}

.media-editor-controls {
  display: grid;
  align-content: start;
  gap: 12px;
}

.media-editor-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.media-editor-controls input[type="number"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

.media-editor-brightness {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.media-editor-brightness span,
.media-editor-brightness input {
  grid-column: 1 / -1;
}

.media-editor-brightness output {
  color: var(--accent);
  font-weight: 800;
}

.media-editor-status {
  min-height: 22px;
  margin: 0;
  padding: 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.media-editor-actions {
  padding: 18px 24px 22px;
}

.section-block.employee-certificate-panel {
  margin-top: 28px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.employee-certificate-panel .section-heading {
  margin-bottom: 14px;
}

.employee-certificate-panels [hidden] {
  display: none !important;
}

.employee-certificate-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.employee-certificate-card {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.05);
}

.certificate-card-content {
  min-width: 0;
}

.certificate-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.certificate-card-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.certificate-card-number {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.certificate-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  min-height: 220px;
  border: 1px solid #dbe5ed;
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.certificate-card-image:hover {
  border-color: rgba(18, 112, 92, 0.45);
  box-shadow: 0 12px 24px rgba(18, 112, 92, 0.1);
  transform: translateY(-1px);
}

.certificate-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.certificate-card-image span {
  font-size: 14px;
  font-weight: 800;
}

.certificate-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.certificate-card-meta div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e8eef3;
  border-radius: 6px;
  background: #f8fafb;
}

.certificate-card-meta .wide-field {
  grid-column: 1 / -1;
}

.certificate-card-meta dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.certificate-card-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  word-break: break-word;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 10px 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.footer-inner span:last-child {
  margin-left: auto;
  text-align: right;
}

@media (max-width: 920px) {
  .header-inner,
  .hero-panel,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 40px;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .main-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .current-user {
    align-self: flex-start;
  }

  .compact-title,
  .dashboard-grid,
  .project-grid,
  .module-card-grid,
  .employee-certificate-card-grid,
  .record-form,
  .search-bar,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-title {
    align-items: start;
  }

  .employee-profile-layout {
    grid-template-columns: 1fr;
  }

  .employee-certificate-card {
    grid-template-columns: 1fr;
  }

  .certificate-card-image {
    min-height: 220px;
    aspect-ratio: 16 / 10;
  }

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

  .identity-card-grid {
    grid-template-columns: 1fr;
  }

  .media-editor-body {
    grid-template-columns: 1fr;
  }

  .identity-tool-workspace,
  .identity-result-grid {
    grid-template-columns: 1fr;
  }

  .identity-result-batch-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .media-editor-canvas-wrap {
    min-height: 320px;
  }

  .employee-modal-profile {
    grid-template-columns: 148px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .footer-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-inner {
    width: 100%;
    padding: 14px;
  }

  .page-shell {
    width: 100%;
    padding: 14px 14px 40px;
  }

  .brand {
    min-width: 0;
  }

  .hero-panel,
  .section-block {
    padding: 22px;
  }

  .compact-title,
  .hero-metrics,
  .dashboard-grid,
  .project-grid,
  .module-card-grid,
  .record-form,
  .search-bar,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .certificate-chart {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .certificate-chart-legend {
    grid-template-columns: 1fr;
  }

  .personal-certificate-detail-layout {
    grid-template-columns: 1fr;
  }

  .personal-certificate-image-panel .certificate-image-frame {
    min-height: 260px;
  }

  .company-certificate-upload-grid,
  .company-certificate-image-grid {
    grid-template-columns: 1fr;
  }

  .compact-title {
    display: grid;
  }

  .modal-backdrop {
    padding: 14px;
  }

  .employee-modal-profile {
    grid-template-columns: 1fr;
  }

  .employee-modal-avatar .avatar-upload-preview {
    height: 180px;
  }

  .modal-header,
  .modal-form {
    padding-left: 18px;
    padding-right: 18px;
  }

  .record-form .span-2 {
    grid-column: auto;
  }

  .employee-profile-grid {
    grid-template-columns: 1fr;
  }

  .media-editor-backdrop {
    padding: 14px;
  }

  .media-editor-body {
    padding: 18px;
  }

  .media-editor-actions {
    padding: 16px 18px 20px;
  }

  .identity-upload-zone {
    min-height: 180px;
    padding: 22px;
  }

  .identity-tool-actions {
    justify-content: flex-start;
  }

  .identity-tool-actions .button {
    width: 100%;
  }

  .footer-inner,
  .status-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
