body {
  margin: 0;
  font-family: sans-serif;
}

header {
  padding: 16px 24px;
}

header h1 {
  margin: 0 0 16px;
  color: #111;
  text-decoration: none;
}

header h1 a {
  text-decoration: none;
  color: inherit;
}

header h1 a:hover {
  color: #2e7d32;
}

header nav {
  padding: 6px 16px;
  background-color: #f7f7f7;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.error {
  color: #dc3545;
  font-size: 0.9rem;
}

.help-text {
  color: #666;
  font-size: 0.9rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
}

.main-nav li {
  margin: 0;
}

.main-nav a {
  display: block;
  padding: 10px 14px;
  color: #222;
  text-decoration: none;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: 
      background-color 0.2s,
      color 0.2s,
      border-color 0.2s;
}

.main-nav a:hover {
  color: #fff;
  background-color: #4caf50;
  border-color: #4caf50;
}

.main-nav a.active {
  color: #fff;
  font-weight: bold;
  background-color: #2e7d32;
  border-color: #2e7d32;
}

.main-nav form {
  margin: 0;
}

.logout-form {
  margin: 0;
}

.logout-button {
  padding: 10px 14px;
  color: #333;
  background-color: #f8d7da;
  border: 1px solid #e2aeb3;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  transition: 
      background-color 0.2s,
      color 0.2s;
}

.logout-button:hover {
  color: #fff;
  background-color: #c62828;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background-color: fff;
}

.table th,
.table td {
  padding: 10px 12px;
  border: 1px solid #ddd;
}

.table th {
  background-color: #f3f6f3;
  font-weight: bold;
  text-align: center;
}

.table tbody tr:hover {
  background-color: #f8fdf8;
}

.table-wrapper {
  margin-top: 30px;
  width: 100%;
  overflow-x: auto;
}

 /* ボタン */
.btn {
  display: block;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: 
      background-color 0.2s,
      color 0.2s,
      opacity 0.2s;
}

/* 登録 */
.btn-primary {
  background: #2e7d32;
  border: 1px solid #256428;
  color: #fff;
}

.btn-primary:hover {
  background-color: #256428;
  border-color: #1f5421;
}

/* CSV */
.btn-secondary {
  background: #607d8b;
  color: white;
}

.btn-secondary:hover {
  background-color: #455a64;
}

/* 削除 */
.btn-danger {
  background: #c62828;
  color: white;
}

.btn-danger:hover {
  background-color: #8e0000;
}

.btn-light {
  display: inline-block;
  padding: 10px 20px;
  background: #f8f9fa;
  background-color: #fff;
  color: #333;
  border: 1px solid #ced4da;
  border-radius: 6pc;
  text-decoration: none;
}

.btn-light:hover {
  background-color: #e9ecef;
}

/* 検索 */
.btn-search {
  background: #1976d2;
  color: white;
}

/* ページネーション */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 12px;
  color: #222;
  text-decoration: none;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.pagination a:hover {
  color: #fff;
  background-color: #4caf50;
  border-color: #4caf50;
}

.pagination .active span {
  color: #fff;
  font-weight: bold;
  background-color: #2e7d32;
  border-color: #2e7d32;
}

.pagination .disabled span {
  color: #999;
  background-color: #f5f5f5;
  cursor: default;
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.action-form {
  display: inline-flex;
  margin: 0;
}

.action-buttons .btn {
  width: auto;
  min-width: auto;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 6px;
  line-height: 1.2;
}

.action-buttons .btn-sm {
  padding: 6px 10px;
  border-radius: 5px;
}

.search-title {
  margin-top: 30px;
  margin-bottom: 20px;
}

.search-form {
  width: 100%;
  max-width: 900px;
  padding: 24px 30px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background-color: #fafafa;
  margin-bottom: 30px;
}

.search-form > div:not(.search-actions) {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.search-form label {
  width: 180px;
  display: inline-block;
  width: 120px;
  font-weight: bold;
}

.search-form input,
.search-form select {
  width: 100%;
  max-width: 630px;
  padding: 8px 10px;
  box-sizing: border-box;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.form-card {
  width: 100%;
  max-width: 750px;
  padding: 30px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background-color: #fafafa;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 630px;
  padding: 8px 10px;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.error-list {
  margin-top: 12px;
  color: #c62828;
}

.error-list ul {
  margin: 0;
  padding-left: 20px;
}

.import-actions {
  margin-top: 20px;
  margin-bottom: 30px;
}

.import-actions .btn {
  width: 260px;
}

.detail-card {
  width: 100%;
  max-width: 600px;
  padding: 24px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
}

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

.detail-table th,
.detail-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #ddd;
}

.detail-table th {
  width: 150px;
  text-align: left;
  background-color: #f5f7f5;
  vertical-align: top;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.form-title {
  margin-top: 30px;
  margin-bottom: 20px;
}

.log-status {
  display: inline-block;
  min-width: 70px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
}

.log-corrected {
  color: #664d03;
  background-color: #fff3cd;
  border: 1px solid #ffe69c;
}

.log-correction {
  color: #444;
  background-color: #e9ecef;
  border: 1px solid #ced4da;
}

.auth-container {
  width: 100%;
  max-width: 550px;
}

.auth-card {
  width: 100%;
  box-sizing: border-box;
}

.auth-card .form-group input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.auth-register {
  margin-top: 20px;
}

.error-box {
  margin-bottom: 20px;
}

.summary-item {
  padding: 24px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}

.summary-label {
  display: block;
  margin-bottom: 15px;
  font-weight: bold;
}

.summary-value {
  text-align: center;
}

.summary-value strong {
  font-size: 32px;
}

.dashboard-summary {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 40px;
}

.summary-item {
  flex: 1;
}

.summary-danger {
  background-color: #fff1f1;
  border-color: #e5bcbc;
}

.summary-warning {
  background-color: #fff9e6;
  border-color: #e5d7a5;
}

.stock-danger-row {
  background-color: #fff5f5;
}

.stock-warning-row {
  background-color: #fffbea;
}