:root {
  color-scheme: light;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Arial, sans-serif;
  color: #0f172a;
  background: #f8fafc;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f8fafc;
}

button,
input,
select {
  font: inherit;
}

.navbar {
  min-height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.logo {
  color: #2563eb;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
  line-height: 1;
}

.site-logo img {
  display: block;
  width: 170px;
  height: 38px;
  object-fit: contain;
}

.user-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: #334155;
  font-size: 14px;
}

.btn-logout,
/* 권한이 없어 숨긴 메뉴(hidden)는 아래 display 지정보다 우선해 보이지 않아야 한다. */
.btn-outline[hidden] {
  display: none !important;
}

.btn-outline {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.container {
  width: min(1200px, calc(100% - 48px));
  margin: 32px auto 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.status-banner {
  min-height: 58px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
}

.status-banner.notice-ok {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.status-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.metric-card,
.card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.metric-card {
  padding: 20px;
}

.metric-label {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
}

.account-management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.stack,
.vet-invite-form,
.profile-edit-form,
.account-form,
.hospital-kg-form,
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hospital-kg-panel-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
}

.hospital-kg-panel-body[hidden] {
  display: none;
}

.kg-toggle-button {
  flex: 0 0 auto;
  min-width: 72px;
}

.card {
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.card-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.owner-vet-role{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:16px 0;padding:12px 14px;border:1px solid #bfdbfe;border-radius:7px;background:#eff6ff}
.owner-vet-role strong{font-size:13px;color:#1e3a8a}
.owner-vet-role p{margin:4px 0 0;font-size:12px;color:#4e6890;line-height:1.5}
.owner-vet-role .btn-primary,.owner-vet-role .btn-outline{flex:none;white-space:nowrap}
.owner-vet-status{display:inline-block;margin-left:4px;padding:2px 7px;border:1px solid #bfdbfe;border-radius:20px;background:#fff;color:#2563eb;font-size:11px}
.owner-vet-file-row{display:flex;align-items:center;gap:10px;min-height:42px;color:#64748b;font-size:13px}
.owner-vet-file-row input[type=file]{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.owner-vet-file-row input[type=file]:focus-visible+label{outline:2px solid #2563eb;outline-offset:2px}
.owner-vet-file-row label{cursor:pointer}
@media(max-width:700px){.owner-vet-role{align-items:flex-start;flex-direction:column}.owner-vet-file-row{flex-wrap:wrap}}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.form-help {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
}

#kgSourceUpload {
  height: 42px;
  padding: 6px 10px;
  line-height: 28px;
}

#kgSourceUpload::file-selector-button {
  height: 28px;
  margin: 0 10px 0 0;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #172337;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
}

.textarea-input {
  min-height: 110px;
  padding: 10px;
  resize: vertical;
}

.kg-help {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 12px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.55;
}

.kg-help strong {
  color: #1d4ed8;
}

.btn-primary {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary:disabled,
.btn-danger:disabled,
.btn-outline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.muted {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.list-table th,
.list-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.list-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-hospital,
.scope-hospital_invited {
  background: #dbeafe;
  color: #1e40af;
}

.badge-request,
.scope-hospital_affiliation_requested {
  background: #fef3c7;
  color: #92400e;
}

.badge-individual,
.scope-individual_veterinarian,
.scope-unknown {
  background: #f1f5f9;
  color: #475569;
}

.status-active {
  color: #1d4ed8;
}

.status-requested,
.status-invited {
  color: #92400e;
}

.status-rejected,
.status-removed,
.btn-danger {
  color: #991b1b;
}

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

.btn-danger {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fee2e2;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.account-card .btn-danger {
  min-height: 42px;
  font-size: 14px;
}

.danger-card {
  border-color: #fecaca;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.check-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.withdrawal-notice {
  margin: 0;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.account-status.error {
  color: #b91c1c;
}

.profile-list {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  font-size: 14px;
}

.profile-list dt {
  color: #64748b;
  font-weight: 700;
}

.profile-list dd {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-edit-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
}

.profile-status {
  margin-top: 14px;
}

.modal-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgb(15 23 42 / 24%);
}

.modal-dialog::backdrop {
  background: rgb(15 23 42 / 45%);
}

.modal-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: #ffffff;
}

.notification-page {
  max-width: 960px;
}

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

.notification-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.notification-card.unread {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.notification-card p {
  margin: 6px 0;
  color: #334155;
}

.notification-body {
  margin: 6px 0;
  color: #334155;
}

.notification-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.notification-body .ql-size-small {
  font-size: 0.75em;
}

.notification-body .ql-size-large {
  font-size: 1.35em;
}

.notification-body .ql-size-huge {
  font-size: 1.8em;
}

.notification-body table {
  width: 100%;
  border-collapse: collapse;
}

.notification-body th,
.notification-body td {
  padding: 8px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.notification-card small {
  color: #64748b;
}

.doc-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.sub-title {
  margin: 8px 0 0;
  color: #1e40af;
  font-size: 14px;
}

.kg-claim-list {
  gap: 12px;
}

.kg-claim-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.kg-claim-card p {
  margin: 6px 0;
  color: #334155;
  font-size: 13px;
}

.kg-claim-card small {
  color: #475569;
  font-weight: 700;
}

.doc-link {
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
}

.empty-state {
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  background: #f8fafc;
  font-size: 13px;
}

@media (max-width: 900px) {
  .metrics-grid,
  .main-grid,
  .account-management-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .navbar,
  .user-menu,
  .status-banner,
  .banner-actions,
  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .container {
    width: min(100% - 24px, 1200px);
    margin-top: 20px;
  }

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

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

