* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.5rem 3rem 2.5rem;
  text-align: center;
  max-width: 800px;
  width: 90vw;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

h1 {
  margin: 0 0 1.75rem;
  font-size: 2rem;
  color: #111827;
}

.status {
  color: #6b7280;
}

.hidden {
  display: none;
}

code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

#table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

thead th {
  background: #f9fafb;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  color: #374151;
}

tbody td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #f0f1f3;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f9fafb;
}

.entry-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  align-items: end;
  justify-content: center;
  text-align: left;
  margin-bottom: 0.5rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-row label {
  font-size: 0.8rem;
  color: #6b7280;
}

.form-row input,
.form-row select {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  color: #1f2937;
  font-size: 0.9rem;
  min-width: 140px;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.entry-form button {
  background: #22c55e;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  height: fit-content;
}

.entry-form button:hover {
  background: #16a34a;
}

.entry-form button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.form-status {
  width: 100%;
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.5rem 0 1rem;
}

.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.secondary-btn {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #1f2937;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #f3f4f6;
}

.total-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #16a34a;
  margin: 0 0 1rem;
}

.actions-cell {
  white-space: nowrap;
  text-align: right;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  line-height: 1;
}

.icon-btn:hover {
  background: #f3f4f6;
}

.edit-btn {
  color: #eab308;
}

.delete-btn {
  color: #ef4444;
}

.danger-btn {
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.danger-btn:hover {
  background: #dc2626;
}

.delete-dialog {
  border: none;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  max-width: 320px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.delete-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.delete-dialog p {
  margin: 0 0 0.4rem;
}

.delete-dialog-sub {
  font-size: 0.85rem;
  color: #6b7280;
}

.delete-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
}