body {
  font-family: "Nunito", sans-serif;
  background-color: #fff9ff;
  color: #333;
  margin: 0;
  padding: 0;
  text-align: center;
}

.header {
  background-color: #f8bbd0;
  padding: 1rem;
}

.navbar {
  display: flex;
  justify-content: flex-end;
}

.navbar-item {
  color: white;
  margin-left: 1rem;
  text-decoration: none;
}

.main {
  margin: 2rem 0;
}

.hero {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.hero-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
}

.form-section {
  display: flex;
  justify-content: center;
  margin-top: 0px; /* Adjust this value to align the form with the hero */
}

.form-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 60%;
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  margin-bottom: 1rem;
}

.cat-image {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
}

.file-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px dashed #ccc;
  padding: 20px;
  text-align: center;
  cursor: pointer;
}

.file-upload .default-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  height: auto;
  opacity: 0.5;
}

.file-upload.dragover {
  border-color: #000;
}

.thumbnail {
  width: 150px;
  height: 150px;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  cursor: pointer;
}

form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

form label {
  margin-top: 1rem;
}

form input,
form select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
}

.submit-btn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #f8bbd0;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.submit-btn:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}

.submit-btn:hover:enabled {
  background-color: #f06292;
}

.thumbnail canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#thumbnail img,
#thumbnail canvas {
  width: 100%; /* Adjusts the thumbnail size */
  height: auto;
}

#error-message {
  color: #333;
  background-color: #e6ffe6;
  padding: 0.5rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  height: 1.5rem;
  line-height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#error-message.error {
  background-color: #ffe6e6;
  color: red;
}

#error-message.normal {
  background-color: #e6ffe6;
  color: #333;
}

#filename-info p {
  margin: 5px 0;
}

#popup-overlay {
  visibility: hidden; /* Use visibility instead of display to hide the element */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#popup-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

#popup-content img {
  max-width: 100%;
  max-height: 80vh;
}

.hidden {
  display: none;
}

.input-error {
  background-color: yellow;
  color: red;
}

/* ──── ローカルモード警告バナー ──── */
.local-mode-banner {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

/* ──── ダッシュボード ──── */
.dashboard-container {
  width: 85%;
  max-width: 1200px;
  align-items: flex-start;
}

.search-form {
  width: 100%;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
  margin-bottom: 1rem;
}

.search-field {
  display: flex;
  flex-direction: column;
}

.search-field-wide {
  grid-column: span 2;
}

.search-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.clear-btn {
  padding: 0.5rem 1rem;
  background-color: #e0e0e0;
  color: #333;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.clear-btn:hover {
  background-color: #bdbdbd;
}

#results-container {
  width: 100%;
  margin-top: 1.5rem;
}

.results-count {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  text-align: left;
}

.no-results {
  color: #999;
  padding: 1rem 0;
  text-align: center;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.results-table th {
  background-color: #f8bbd0;
  color: white;
  padding: 0.6rem 0.75rem;
  white-space: nowrap;
}

.results-table td {
  border-bottom: 1px solid #eee;
  padding: 0.5rem 0.75rem;
}

.results-table tr:hover td {
  background-color: #fff0f5;
}

.amount-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.type-in {
  color: #2e7d32;
  font-weight: bold;
}

.type-out {
  color: #c62828;
  font-weight: bold;
}

.view-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  background-color: #f8bbd0;
  color: white;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
}

.view-btn:hover:not(:disabled) {
  background-color: #f06292;
}

.view-btn:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}
