@import url("base.css");

main {
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid #3f51b5;
}

section {
  margin-bottom: 2rem;
}

/* 処理結果のメッセージ */
.message {
  margin: 0.5rem 0 1.5rem 0;
  padding: 0.8rem;
  border-radius: 4px;
  line-height: 1.5;
}

.message.success {
  color: #1b5e20;
  background-color: #e8f5e9;
  border: 1px solid #66bb6a;
}

.message.warn {
  color: #7f5700;
  background-color: #fff8e1;
  border: 1px solid #ffb300;
}

.message.error {
  color: #7f5700;
  background-color: #fff8e1;
  border: 1px solid #ffb300;
}

.message.danger {
  color: #fff;
  background-color: #e53935;
  border: 1px solid #b71c1c;
}

/* 注文フォーム */
section.order form {
  display: block;
  margin-bottom: 0.5rem;
}

.order-form {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.order-form label {
  font-size: 0.9rem;
}

.order-form select,
.order-form input[type="number"] {
  font-size: 1rem;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.order-form input[type="number"] {
  width: 5rem;
}

.order-buttons {
  display: flex;
  flex-flow: row wrap;
  gap: 0.8rem;
}

.order-buttons button {
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  padding: 10px 20px;
  cursor: pointer;
}

/* トランザクションを使わない注文(危険な操作) */
.order-buttons button.btn-notx {
  background-color: #e53935;
}

.order-buttons button.btn-notx:hover {
  background-color: #b71c1c;
}

/* トランザクションを使う注文 */
.order-buttons button.btn-tx {
  background-color: #3f51b5;
}

.order-buttons button.btn-tx:hover {
  background-color: #2f3a7d;
}

.note {
  font-size: 0.85rem;
  color: #666;
  margin: 0.5rem 0 0 0;
}

/* 一覧表 */
table {
  border-collapse: collapse;
  width: 100%;
  max-width: 720px;
}

table th,
table td {
  padding: 0.5ex 0.8em;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

table th {
  background-color: #eceff1;
  font-size: 0.85rem;
  white-space: nowrap;
}

table th.num,
table td.num {
  text-align: right;
}

/* 帳尻が合っていない商品 */
table tr.inconsistent td {
  color: #b71c1c;
  background-color: #ffebee;
  font-weight: bold;
}

.empty {
  color: #666;
}
