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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 16px;
  text-align: center;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
  margin: 16px 0 10px;
}

/* サマリーカード */
.summary-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.summary-card {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border: 1px solid #c8e6c9;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}

.summary-card .label {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 4px;
}

.summary-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2e7d32;
}

.summary-card .sub {
  font-size: 0.75rem;
  color: #777;
  margin-top: 2px;
}

.summary-card.warning .value {
  color: #e65100;
}

.summary-card.warning {
  border-color: #ffcc80;
  background: #fff8f0;
}

.summary-card.expired .value {
  color: #c62828;
}

.summary-card.expired {
  border-color: #ffcdd2;
  background: #fff5f5;
}

/* タブ */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #e8f5e9;
  border-radius: 8px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 8px 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-btn.active {
  background: #fff;
  color: #2e7d32;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* タブコンテンツ */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* フォーム */
.form-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 8px;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 4px;
  font-weight: 500;
}

.form-row input,
.form-row select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #333;
  background: #fafafa;
  outline: none;
  transition: border-color 0.15s;
}

.form-row input:focus,
.form-row select:focus {
  border-color: #4caf50;
  background: #fff;
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #388e3c;
}

/* リスト */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.list-item.warning-item {
  border-color: #ffcc80;
  background: #fff8f0;
}

.list-item.expired-item {
  border-color: #ffcdd2;
  background: #fff5f5;
}

.item-info {
  flex: 1;
}

.item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 3px;
}

.item-meta {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.5;
}

.item-remain {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2e7d32;
  white-space: nowrap;
}

.item-remain.warning {
  color: #e65100;
}

.item-remain.expired {
  color: #c62828;
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 6px;
}

.badge-warning {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.badge-expired {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.btn-delete {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.btn-delete:hover {
  color: #e53935;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.875rem;
  padding: 20px 0;
}

/* レスポンシブ */
@media (max-width: 400px) {
  .summary-card .value {
    font-size: 1.4rem;
  }

  .list-item {
    flex-wrap: wrap;
  }
}
