*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #222;
}

a {
  color: #0b63ce;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.site-header {
  background: #111827;
  color: #fff;
  margin-bottom: 1.5rem;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo {
  font-size: 1.1rem;
  margin: 0;
}

.logo .user-label {
  font-size: 1.0rem;
  font-weight: 700;
  margin-left: 0.75rem;
  color: #ffffff;
}

.site-header nav a {
  margin-left: 1rem;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.site-header nav a:hover {
  color: #fff;
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  padding: 0.75rem 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.09);
  margin-bottom: 1.5rem;
}

h1, h2, h3 {
  margin-top: 0;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

textarea {
  resize: vertical;
}

input[readonly],
textarea[readonly] {
  background: #f3f4f6;
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #111827;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.5rem;
  white-space: nowrap;
}

.btn.primary {
  background: #2563eb;
  color: #fff;
}

.btn.danger {
  background: #ef4444;
  color: #fff;
}

.btn.small {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.table thead th {
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table.compact th,
.table.compact td {
  padding: 0.3rem 0.4rem;
}

.numeric {
  text-align: right;
}

.center {
  text-align: center;
}

.flash-messages {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.flash-success {
  background: #dcfce7;
  color: #166534;
}

.flash-error {
  background: #fee2e2;
  color: #b91c1c;
}

.subtle {
  color: #6b7280;
  font-size: 0.8rem;
}

.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.main-amount {
  font-weight: 600;
}

.mini-amount {
  font-size: 0.75rem;
  color: #4b5563;
  line-height: 1.2;
}
