:root {
  font-family: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #18181b;
  background: #fff;
  font-synthesis: none;
  --muted: #65656e;
  --line: #e8e8ec;
  --soft: #f8f8fa;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { touch-action: manipulation; }
:focus-visible { outline: 3px solid #737383; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 3vw, 32px); line-height: 1.2; letter-spacing: -1.1px; font-weight: 650; }
h2 { font-size: 19px; letter-spacing: -.45px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.header-inner { max-width: 1360px; margin: auto; padding: 22px 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.identity { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 17px; font-weight: 500; letter-spacing: -.4px; }
.identity strong { font-weight: 750; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: #18181b; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 22px; font-weight: 750; position: relative; }
.brand-mark span { position: absolute; width: 4px; height: 4px; border-radius: 1px; background: #a7a7b1; bottom: 9px; right: 7px; }
.account { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #f0f0f3; border: 1px solid var(--line); display: grid; place-items: center; flex-shrink: 0; font-size: 12px; font-weight: 650; }
.profile-copy { display: flex; flex-direction: column; min-width: 0; }
.profile-caption { color: var(--muted); font-size: 11px; }
.profile-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.wrap { max-width: 1360px; padding: 46px 40px 24px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.eyebrow { font-size: 10px; letter-spacing: 1.6px; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.page-description { margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; min-height: 42px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .16s, border-color .16s, box-shadow .16s; }
.btn-primary { background: #18181b; color: #fff; box-shadow: 0 1px 2px #00000012; }
.btn-primary:hover { background: #343439; }
.btn-secondary { background: #fff; border-color: #dcdce2; color: #26262b; box-shadow: 0 1px 2px #00000005; }
.btn-secondary:hover, .btn-ghost:hover { background: #f4f4f6; border-color: #ceced6; }
.btn-ghost { background: transparent; color: #50505a; border-color: var(--line); }
.logout-btn { margin-left: 9px; min-height: 34px; padding: 6px 11px; }
.btn-danger { color: #b4232f; background: #fff; border-color: #f1d9dd; }
.btn-danger:hover { background: #fff1f3; border-color: #e5adb6; }
.btn:disabled { opacity: .6; cursor: wait; }
.full { width: 100%; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 12px #18181b03; }
.table-card { overflow: hidden; }
.table-heading { padding: 23px 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.table-heading h2 { font-size: 16px; }
.table-heading p { font-size: 12px; margin-top: 4px; }
.table-tag { border: 1px solid var(--line); background: var(--soft); border-radius: 6px; padding: 4px 9px; color: #5f5f69; font-size: 11px; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 19px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--soft); color: #62626b; font-size: 11px; font-weight: 600; padding-top: 13px; padding-bottom: 13px; border-top: 1px solid var(--line); }
td { font-size: 13px; }
td:first-child { font-weight: 600; }
td:nth-child(2) { font-variant-numeric: tabular-nums; font-weight: 550; }
td:nth-child(3), td:nth-child(4) { color: var(--muted); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }
.actions { display: flex; align-items: center; gap: 7px; }
.actions .btn { padding: 7px 10px; min-height: 34px; font-size: 12px; }
.page-link { font-size: 12px; color: #42424c; text-underline-offset: 4px; text-decoration-color: #c5c5cd; }
.page-link:hover { color: #000; text-decoration-color: #000; }
.page-link::after { content: " ↗"; display: inline-block; margin-left: 4px; }
.table-footer { padding: 14px 25px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); background: #fdfdfd; }
.table-state { text-align: center; padding: 56px 24px; color: var(--muted); font-weight: 400 !important; white-space: normal; }
.table-state strong { display: block; margin: 10px 0 5px; font-size: 14px; color: #27272d; font-weight: 600; }
.table-state p { font-size: 12px; }
.state-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 22px; }
.spinner, #saveBtn:disabled::before { content: ""; display: inline-block; height: 16px; width: 16px; border: 2px solid #dedee4; border-top-color: #50505b; border-radius: 50%; animation: spin .8s linear infinite; }
#saveBtn:disabled::before { border-color: #ffffff50; border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 14px 17px; border-radius: 9px; margin: 0 0 24px; font-size: 13px; border: 1px solid; display: flex; align-items: baseline; gap: 10px; overflow-wrap: anywhere; }
.notice::before { font-weight: 700; flex-shrink: 0; }
.notice.error { background: #fff7f7; color: #a32835; border-color: #f0d8dc; }
.notice.error::before { content: "!"; }
.notice.ok { background: #f1faf5; color: #256644; border-color: #d3eadc; }
.notice.ok::before { content: "✓"; }
.form-card { margin-bottom: 28px; overflow: hidden; }
.form-heading { padding: 24px 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.form-heading .eyebrow { margin-bottom: 5px; }
.record-id { font-size: 11px; margin-top: 5px; overflow-wrap: anywhere; }
.form-section { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; padding: 28px; border-bottom: 1px solid var(--line); }
.section-intro p { margin-top: 6px; font-size: 12px; max-width: 220px; }
.field-hint { display: block; color: var(--muted); font-size: 11px; margin-top: 12px; }
.section-fields { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; min-width: 0; }
.section-fields > .field:last-child, .section-fields > .row:last-child .field { margin-bottom: 0; }
.field label, .upload-box > label { font-size: 12px; font-weight: 600; }
.required { color: #72727c; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; color: #18181b; border: 1px solid #dcdce2; border-radius: 7px; padding: 10px 12px; min-height: 42px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.field input:hover, .field textarea:hover { border-color: #b9b9c4; }
.field input:focus, .field textarea:focus { border-color: #777785; outline: none; box-shadow: 0 0 0 3px #18181b0b; }
.field input::placeholder, .field textarea::placeholder { color: #8c8c95; }
.field textarea { min-height: 98px; resize: vertical; }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 13px; top: 11px; font-size: 13px; color: var(--muted); }
.input-affix input { padding-left: 39px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 80px; gap: 18px; }
.address-street { grid-template-columns: minmax(0, 1fr) 130px; }
.upload-box { border: 1px dashed #d3d3dc; border-radius: 9px; padding: 17px; min-width: 0; background: #fdfdfd; }
.upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 13px; }
.preview-frame { width: 72px; height: 72px; border: 1px solid var(--line); border-radius: 8px; background: #f5f5f7; position: relative; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.preview-frame > span { font-size: 11px; color: var(--muted); }
.preview { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; background: #fff; }
.preview:not([src]), .preview[src=""] { display: none; }
.upload-row input { max-width: 100%; min-width: 0; width: 205px; font-size: 11px; color: var(--muted); }
input::file-selector-button { background: #fff; color: #383840; border: 1px solid #dcdce2; border-radius: 6px; padding: 8px 10px; margin: 0 8px 5px 0; cursor: pointer; font: inherit; }
input::file-selector-button:hover { background: #f4f4f6; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.form-footer { padding: 18px 28px; background: #fafafb; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; font-size: 11px; color: #75757e; }
.auth { max-width: 440px; margin: 9vh auto; padding: 32px; }
.auth .brand { font-size: 23px; font-weight: 650; letter-spacing: -.7px; margin-bottom: 8px; }
.auth > .muted { font-size: 13px; margin-bottom: 26px; }
.auth .field { margin-bottom: 19px; }
.auth .brand-mark { margin-bottom: 23px; width: 40px; height: 40px; }
.qr-box { display: flex; justify-content: center; margin: 22px 0; }
.qr-box img { max-width: 100%; width: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; }
#mfaCode, #enrollCode { letter-spacing: 7px; font-variant-numeric: tabular-nums; text-align: center; font-size: 20px; }
@media (min-width: 1500px) { .wrap { padding-top: 56px; } }
@media (max-width: 1050px) {
  .header-inner { padding: 20px 24px; }
  .wrap { padding: 34px 24px 22px; }
  .form-section { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
  th, td { padding-left: 17px; padding-right: 17px; }
}
@media (max-width: 760px) {
  .header-inner { padding: 16px 20px; gap: 16px; flex-wrap: wrap; }
  .identity { font-size: 15px; gap: 9px; }
  .profile-name { max-width: 160px; }
  .wrap { padding: 30px 20px 20px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 20px; margin-bottom: 26px; }
  .page-description { max-width: 32ch; font-size: 13px; }
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 22px; }
  .section-intro p { max-width: none; }
  .form-heading { padding: 22px; }
  .table-heading { padding: 20px; }
  .table-tag { display: none; }
  .form-footer { padding: 18px 22px; }
  .btn { min-height: 44px; }
  .actions .btn { min-height: 40px; }
  .table-footer { padding: 14px 20px; }
}
@media (max-width: 480px) {
  .header-inner { padding: 16px; }
  .account { width: 100%; padding-top: 13px; border-top: 1px solid var(--line); }
  .profile-name { max-width: 210px; }
  .logout-btn { margin-left: auto; }
  .wrap { padding: 28px 16px 20px; }
  .page-heading > .btn { width: 100%; }
  .row, .row3, .address-street { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .upload-grid { gap: 14px; }
  .section-fields > .row:last-child .field { margin-bottom: 18px; }
  .section-fields > .row:last-child .field:last-child { margin-bottom: 0; }
  .form-heading, .form-section { padding: 20px 16px; }
  .form-footer { padding: 16px; }
  .auth { margin: 24px 16px; padding: 26px 22px; }
  .page-footer { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
