body {
  font-family: "Yu Gothic", "Hiragino Sans", sans-serif;
  margin: 0;
  background: linear-gradient(160deg, #f4f6fb 0%, #eef4ff 100%);
  color: #1f2937;
  min-height: 100vh;
}
.hidden {
  display: none !important;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
input,
select,
button {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.field {
  margin-bottom: 14px;
}
.hint {
  color: #6b7280;
  font-size: 12px;
  margin-top: 4px;
}
.title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}
.subtitle {
  color: #6b7280;
  margin-bottom: 14px;
}

/* Centered single-card screen (login, register, password screens) */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 28px;
}
.login-card.wide {
  width: min(640px, 94vw);
}
.login-card form {
  margin-top: 10px;
}
.login-card .actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.actions button {
  background: #2563eb;
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
}
button.secondary {
  background: #fff;
  color: #2563eb;
  border: 1px solid #2563eb;
}
.actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-links {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.login-links a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}
.login-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  margin-top: 12px;
}
.login-success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  margin-top: 12px;
}

/* App shell chrome (authenticated pages) */
.app-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.app-header .nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}
.app-header a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.app-header button.logout {
  width: auto;
  background: #fff;
  color: #6b7280;
  border: 1px solid #d1d5db;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 14px;
}
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 32px;
}

/* Registration wizard */
.wizard-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #9ca3af;
}
.wizard-steps .step {
  flex: 1;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 3px solid #e5e7eb;
}
.wizard-steps .step.active {
  color: #2563eb;
  font-weight: 700;
  border-bottom-color: #2563eb;
}
.wizard-steps .step.done {
  color: #166534;
  border-bottom-color: #86efac;
}

/* Bank account rows (registration form) */
.bank-account-row {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.bank-account-row .row-title {
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bank-account-row .remove-row {
  width: auto;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.bank-account-row .row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bank-account-row .row-fields .span-2 {
  grid-column: 1 / -1;
}
.search-result-list {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  max-height: 160px;
  overflow-y: auto;
  margin-top: 4px;
  background: #fff;
}
.search-result-list div {
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}
.search-result-list div:hover {
  background: #eef4ff;
}
.postal-code-field {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.postal-code-field input {
  flex: 1;
}
.postal-code-field button {
  width: auto;
  white-space: nowrap;
}
.bank-account-row .selected-tag {
  display: inline-block;
  background: #eef4ff;
  color: #2563eb;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  margin-top: 4px;
}
.primary-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.primary-flag input {
  width: auto;
}
.primary-flag label {
  margin: 0;
  font-weight: 500;
}
button.add-row {
  width: auto;
  background: #fff;
  color: #2563eb;
  border: 1px dashed #93c5fd;
  cursor: pointer;
}

/* History / upload tables */
table.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.history-table th,
table.history-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #f1f5f9;
}
table.history-table th {
  color: #6b7280;
  font-weight: 600;
}
.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge.clean,
.status-badge.synced,
.status-badge.approved {
  background: #f0fdf4;
  color: #166534;
}
.status-badge.pending {
  background: #fffbeb;
  color: #92400e;
}
.status-badge.infected,
.status-badge.failed,
.status-badge.rejected {
  background: #fef2f2;
  color: #b91c1c;
}
.overdue-mark {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}
.admin-role-badge {
  display: inline-block;
  background: #eef4ff;
  color: #2563eb;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.reject-panel {
  margin-top: 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 16px;
  background: #fef2f2;
}
.reject-panel textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  min-height: 80px;
}
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-tabs a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  color: #374151;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.filter-tabs a.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.detail-list {
  margin: 0;
}
.detail-list dt {
  color: #6b7280;
  font-size: 12px;
  margin-top: 12px;
}
.detail-list dd {
  margin: 2px 0 0;
  font-weight: 600;
}
iframe.pdf-frame {
  width: 100%;
  height: 70vh;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.success-panel {
  text-align: center;
}
.success-panel .icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.success-panel dl {
  text-align: left;
  margin: 20px 0;
  font-size: 14px;
}
.success-panel dt {
  color: #6b7280;
  font-size: 12px;
  margin-top: 10px;
}
.success-panel dd {
  margin: 2px 0 0;
  font-weight: 600;
}
.success-panel .actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
.success-panel .actions button {
  width: auto;
  padding: 10px 18px;
}

.empty-state {
  text-align: center;
  color: #9ca3af;
  padding: 32px 0;
  font-size: 14px;
}
