*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', 'Meiryo', sans-serif;
  background: #eef1f6;
  color: #1a1a2e;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.page.wide {
  max-width: 1200px;
}

.form-grid {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 10px 12px;
  align-items: center;
  margin-top: 16px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.input-num {
  width: 5.2rem;
  padding: 4px 6px;
  border: 1px solid #c5c9d4;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
}

.input-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c5c9d4;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

.input-select.over-95 {
  background: #fff4f2;
}

.input-memo {
  width: 12rem;
  padding: 4px 6px;
  border: 1px solid #c5c9d4;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
}

.narrow {
  max-width: 420px;
  padding-top: 48px;
}

.app-title {
  text-align: center;
  font-size: 1.75rem;
  margin: 24px 0 8px;
}

.muted {
  color: #666;
  text-align: center;
}

.note {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.error {
  color: #b42318;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  cursor: pointer;
  background: #3860b2;
  color: #fff;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: #3860b2;
}

.btn-warn {
  background: #b42318;
}

.withhold-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}

.withhold-card-warn {
  outline: 2px solid #b42318;
}

.withhold-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.withhold-amount {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 8px 0;
}

.status-warn {
  color: #b42318;
  font-weight: 700;
}

.status-ok {
  color: #1a7f4b;
  font-weight: 700;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c5c9d4;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 12px;
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e4e7ee;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: #555;
  font-weight: 600;
}

.row-inactive td {
  color: #888;
}

.row-mismatch td {
  background: #fff4f2;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.placeholder-box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
}

.section-title {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  opacity: 0;
  transition: 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-error {
  background: #b42318;
}
