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

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

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

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1e293b;
  border-left: 4px solid #2563eb;
  padding-left: 12px;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #475569;
}

/* フォームセクション */
.form-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

input[type="text"],
input[type="number"],
input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #2563eb;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* フィルター */
.filter-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #475569;
}

.filter-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #475569;
}

.filter-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.filter-btn:hover:not(.active) {
  border-color: #2563eb;
  color: #2563eb;
}

/* サマリー */
.summary-section {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.summary-item {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  flex: 1;
  min-width: 140px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.summary-label {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 4px;
}

.summary-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ef4444;
}

.summary-value.paid {
  color: #16a34a;
}

/* リスト */
.list-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.invoice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-message {
  text-align: center;
  color: #94a3b8;
  padding: 24px 0;
  font-size: 0.9rem;
}

/* 請求書カード */
.invoice-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.invoice-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.invoice-card.paid {
  opacity: 0.65;
}

.invoice-info {
  flex: 1;
  min-width: 0;
}

.invoice-client {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.invoice-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.invoice-memo {
  font-size: 0.78rem;
  color: #94a3b8;
}

.overdue-label {
  color: #ef4444;
  font-weight: 600;
}

/* バッジ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-unpaid {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-paid {
  background: #dcfce7;
  color: #15803d;
}

/* ボタン群 */
.invoice-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-toggle {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #475569;
}

.btn-toggle:hover {
  background: #e2e8f0;
}

.btn-delete {
  background: none;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #ef4444;
  transition: all 0.2s;
}

.btn-delete:hover {
  background: #fee2e2;
}
