*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  background: #155e75;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}

.panel {
  background: white;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.panel-pad {
  padding: 18px;
}

.btn {
  min-height: 36px;
  border-radius: 6px;
  padding: 7px 12px;
  border: 1px solid #c7d0dc;
  background: white;
  color: #172033;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: #f1f5f9;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  border-color: #155e75;
  background: #155e75;
  color: white;
}

.btn-primary:hover {
  background: #134e5f;
}

.btn-danger {
  border-color: #b91c1c;
  color: #b91c1c;
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: inherit;
}

.field label {
  display: block;
  margin-bottom: 5px;
  color: #526071;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #c7d0dc;
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
  outline: none;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #155e75;
  box-shadow: 0 0 0 3px rgba(21, 94, 117, 0.12);
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid #e7ecf2;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #526071;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

td input {
  width: 92px;
  border: 1px solid #c7d0dc;
  border-radius: 5px;
  padding: 6px 8px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d8dee9;
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  border: 0;
  background: transparent;
  padding: 11px 14px;
  color: #526071;
  border-bottom: 3px solid transparent;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.tab.active {
  color: #155e75;
  border-bottom-color: #155e75;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge-editing,
.badge-draft {
  background: #fef3c7;
  color: #92400e;
}

.badge-locked,
.badge-agreed {
  background: #dcfce7;
  color: #166534;
}

.badge-sent {
  background: #dbeafe;
  color: #1e40af;
}

.notice {
  border-radius: 8px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  padding: 10px 12px;
  font-size: 14px;
}

.error {
  border-radius: 8px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 14px;
}

.empty {
  padding: 28px 12px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.metric {
  border: 1px solid #d8dee9;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.metric strong {
  display: block;
  font-size: 21px;
  letter-spacing: 0;
}

.metric span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .shell {
    padding: 14px;
  }

  .topbar-inner {
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .topbar h1 {
    flex-basis: 100%;
  }

  td input {
    width: 78px;
  }
}
