* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 14px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

header h1 { font-size: 20px; color: #2c3e50; }

.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ボタン */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #3498db; color: #fff; }
.btn-secondary { background: #27ae60; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-outline { background: #fff; color: #555; border: 1px solid #ccc; }
.btn-camera { background: #9b59b6; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 警告バナー */
.alert-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #856404;
  font-weight: bold;
}

/* テーブル */
.table-wrapper {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow-x: auto;
}

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

thead tr {
  background: #2c3e50;
  color: #fff;
}

th {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8f9fa; }

/* 状態バッジ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}
.badge-ok { background: #d4edda; color: #155724; }
.badge-warn { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-expiry { background: #f8d7da; color: #721c24; }

/* 行の色 */
tr.row-danger { background: #fff5f5; }
tr.row-warn { background: #fffdf0; }

/* モーダル */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-large { max-width: 700px; }

.modal-box h2 { margin-bottom: 20px; font-size: 17px; color: #2c3e50; }

/* フォーム */
.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  font-weight: bold;
}

input[type=text],
input[type=number],
input[type=date],
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #3498db;
}

textarea { resize: vertical; }

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.ops { display: flex; gap: 4px; }

@media (max-width: 600px) {
  .form-row { flex-direction: column; }
  header { flex-direction: column; align-items: flex-start; }
}
