:root {
  font-family: Montserrat, Arial, sans-serif;
  color: #26383f;
  background: #f3f5f7;
  font-size: 14px;
  --teal: #0f777c;
  --deep: #075f65;
  --border: #dce4e7;
  --muted: #617078;
  --soft: #e7f3f2;
  --danger: #a62d35;
  --amber: #c98320;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--amber);
}
a {
  color: var(--teal);
  text-underline-offset: 3px;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: #26383f;
  padding: 10px 14px;
  font-weight: 600;
}
button:hover {
  background: #edf3f4;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.primary:hover {
  background: var(--deep);
}
.danger {
  color: var(--danger);
}
.quiet {
  border-color: transparent;
  background: transparent;
}
.small {
  padding: 6px 10px;
  font-size: 12px;
}
.muted {
  color: var(--muted);
  line-height: 1.6;
}
.tiny {
  font-size: 12px;
}
.hidden {
  display: none !important;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  margin: 0 0 10px;
}
h2 {
  font-size: 19px;
  margin: 0 0 16px;
}
h3 {
  font-size: 15px;
  margin: 0 0 10px;
}
p {
  line-height: 1.65;
}
.skip {
  position: fixed;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: #fff;
  padding: 12px;
}
.skip:focus {
  left: 8px;
}
.login-card {
  width: min(480px, calc(100% - 32px));
  margin: 8vh auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 34px;
  box-shadow: 0 12px 35px #19383e12;
}
.site-logo {
  width: 120px;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 22px;
}
.topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 230px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  color: #234148;
}
.brand img {
  width: 48px;
  height: 42px;
  object-fit: contain;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--deep);
  font-weight: 700;
}
.layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}
.sidebar {
  padding: 26px 16px;
  background: #fff;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}
.nav-label,
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
}
.nav-label {
  padding: 0 14px;
  margin: 4px 0 12px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  color: #54636b;
}
.nav button.active {
  background: var(--soft);
  color: var(--deep);
}
.nav-external {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  color: #54636b;
  font-weight: 600;
  text-decoration: none;
  border-radius: 7px;
}
.nav-external:hover {
  background: #edf3f4;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.sidebar-legal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 10px;
  font-size: 11px;
}
.main {
  padding: 32px 36px 60px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 0;
}
.page-head p {
  margin: 0;
  color: var(--muted);
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.page-actions {
  margin-top: -6px;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  padding: 10px 14px;
  color: #26383f;
  font-weight: 600;
  text-decoration: none;
}
.button-link.primary,
.login-card > .button-link {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.card-title-row,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.card-title-row h2,
.detail-head h2,
.result-card h2 {
  margin-bottom: 6px;
}
.card-title-row p,
.detail-head p,
.result-card p {
  margin: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.detail-grid strong,
.detail-grid span {
  display: block;
  margin-top: 4px;
}
.profile-record > .form-section {
  margin-top: 28px;
}
.profile-record > .form-section:first-of-type {
  margin-top: 0;
}
.upload-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.upload-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.upload-card img {
  width: 150px;
  height: 110px;
  object-fit: contain;
  background: #f7f9fa;
  border-radius: 6px;
}
.result-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.result-card > button {
  margin-top: auto;
}
.match-summary {
  min-height: 30px;
}
.filter-panel > .toolbar {
  margin-top: 20px;
}
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  white-space: nowrap;
  padding: 12px 16px;
  color: var(--muted);
}
.tabs button.active {
  border-bottom-color: var(--teal);
  color: var(--deep);
}
.share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.share-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 18px;
}
.path-input,
.copy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.copy-row {
  flex-wrap: wrap;
}
.path-input span {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: var(--muted);
  white-space: nowrap;
}
.copy-row input {
  min-width: 0;
  flex: 1 1 100%;
}
.qr-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.qr-box img {
  width: 150px;
  height: 150px;
}
.toolbar input,
.toolbar select {
  width: auto;
  min-width: 200px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}
th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  background: #f8fafb;
}
tr:last-child td {
  border-bottom: 0;
}
.pill {
  display: inline-block;
  background: var(--soft);
  color: var(--deep);
  border-radius: 99px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  margin: 2px;
}
.form-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
}
.form-section:first-of-type {
  border-top: 0;
  margin-top: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field.full {
  grid-column: 1/-1;
}
.field label,
.field legend {
  font-weight: 600;
}
.required {
  color: var(--danger);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #c9d4d8;
  border-radius: 7px;
  padding: 11px 12px;
  background: #fff;
  color: #26383f;
}
textarea {
  min-height: 105px;
  resize: vertical;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 400 !important;
}
.choice input {
  width: auto;
  margin-top: 2px;
}
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 18px;
}
.toggle-row input {
  width: auto;
  margin-top: 3px;
}
.toggle-row span,
.toggle-row strong,
.toggle-row small {
  display: block;
}
.toggle-row small {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 3px;
}
.maintenance-retention {
  max-width: 360px;
  margin-top: 22px;
}
.input-suffix {
  display: flex;
  align-items: center;
  gap: 10px;
}
.input-suffix input {
  max-width: 180px;
}
.help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.masked {
  border: 1px dashed #aebdc2;
  background: #f7f9fa;
  border-radius: 7px;
  padding: 11px;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 24px;
}
.cf-slot {
  min-height: 65px;
  margin-top: 20px;
}
.notice {
  border-left: 4px solid var(--teal);
  background: var(--soft);
  padding: 14px 16px;
  border-radius: 4px;
  line-height: 1.6;
}
.privacy-input-notice {
  margin-top: 24px;
  border-color: var(--amber);
  background: #fff8e8;
}
.confidentiality-dialog h2 {
  margin-bottom: 12px;
}
.confidentiality-dialog li {
  line-height: 1.6;
  margin-bottom: 8px;
}
.confidentiality-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-bottom: 16px;
  background: #fff1d5;
  color: #815207;
  font-size: 25px;
  font-weight: 700;
}
.ticket-message-field {
  margin-top: 18px;
}
.ticket-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--teal);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ticket-link:hover {
  background: transparent;
  color: var(--deep);
}
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  background: #eef2f3;
  color: #40545c;
}
.status-open {
  background: #fff1d5;
  color: #815207;
}
.status-in_progress {
  background: #e4f0fa;
  color: #225b88;
}
.status-completed {
  background: #e5f3e8;
  color: #286438;
}
.ticket-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ticket-message {
  width: min(820px, 92%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}
.ticket-message.from-admin {
  margin-left: auto;
  border-left: 4px solid var(--teal);
}
.ticket-message.from-user {
  margin-right: auto;
}
.ticket-message-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.ticket-message-head .pill {
  margin-left: 8px;
}
.ticket-message > p {
  margin: 14px 0 0;
}
.match-confirmation {
  text-align: center;
}
.match-confirmation .notice {
  text-align: left;
  margin-top: 20px;
}
.success-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--deep);
  font-size: 30px;
  font-weight: 700;
}
.warning {
  border-color: var(--amber);
  background: #fff8e8;
}
.legal {
  max-width: 850px;
  margin: 35px auto;
  padding: 34px;
}
.legal h2 {
  margin-top: 28px;
}
.legal li {
  line-height: 1.7;
  margin-bottom: 8px;
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: 390px;
  background: #20363c;
  color: #fff;
  border-radius: 8px;
  padding: 13px 17px;
  box-shadow: 0 8px 25px #0003;
  display: none;
}
#toast.show {
  display: block;
}
dialog {
  border: 0;
  border-radius: 11px;
  padding: 0;
  max-width: 660px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px #0004;
}
dialog::backdrop {
  background: #17323899;
}
.dialog-body {
  padding: 26px;
}
.mobile-nav {
  display: none;
}
.impersonation {
  background: #fff1c9;
  color: #6d4b00;
  padding: 9px 18px;
  text-align: center;
  font-weight: 600;
}
.code {
  font-family: ui-monospace, monospace;
  background: #eef2f3;
  padding: 12px;
  border-radius: 6px;
  word-break: break-all;
}
.empty {
  text-align: center;
  padding: 28px;
  color: var(--muted);
}
@media (max-width: 760px) {
  .topbar {
    padding: 0 15px;
  }
  .brand {
    min-width: 0;
  }
  .brand span {
    display: none;
  }
  .layout {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .mobile-nav {
    display: block;
  }
  .main {
    padding: 22px 16px 50px;
  }
  .grid,
  .stats,
  .choices,
  .share-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .share-card,
  .upload-card {
    grid-template-columns: 1fr;
  }
  .upload-card img {
    width: 100%;
    height: 180px;
  }
  .card-title-row,
  .detail-head {
    flex-direction: column;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .top-actions .user-name {
    display: none;
  }
  .login-card {
    padding: 26px;
    margin-top: 4vh;
  }
  .legal {
    margin: 15px;
    padding: 24px;
  }
  .actions {
    justify-content: stretch;
    flex-direction: column;
  }
  .actions button {
    width: 100%;
  }
}
