:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1b1a17;
  --muted: #6b6762;
  --accent: #0f7b6c;
  --accent-dark: #0a5d52;
  --danger: #c0392b;
  --border: #e2ddd4;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Charter", "Georgia", serif;
  color: var(--text);
  background: radial-gradient(circle at top, #fff8ea, #f0ebe2);
}

code {
  font-family: "Courier New", monospace;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0.5px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-large {
  width: min(260px, 70vw);
  height: auto;
  display: block;
  margin-bottom: 12px;
}

.logo-small {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-sale {
  width: 56px;
  height: 56px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 22px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

#auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.auth-row {
  align-items: center;
}

.row.between {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 14px;
  color: var(--muted);
}

input,
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 16px;
  background: #fff;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.danger {
  background: var(--danger);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
  margin: 12px 0 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.total {
  font-size: 20px;
  font-weight: 600;
}

.payment {
  display: flex;
  align-items: center;
  gap: 12px;
}

.success,
.error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.success {
  background: #e7f6f0;
  color: #1d6b54;
}

.error {
  background: #fdecea;
  color: #a12418;
}

.hidden {
  display: none;
}

.screen {
  animation: fadeIn 0.2s ease;
}

.signed-in #auth-screen {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.list {
  display: grid;
  gap: 10px;
}

#recent-sales {
  font-family: "Courier New", monospace;
}

.list-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.list-item span {
  color: var(--muted);
  font-size: 14px;
}

.status {
  font-size: 20px;
  font-weight: 700;
}

.status-ok {
  color: #1d6b54;
}

.status-void {
  color: #a12418;
}

.footer {
  text-align: center;
  color: var(--muted);
  margin-top: 32px;
}

@media (max-width: 680px) {
  .summary {
    flex-direction: column;
    align-items: flex-start;
  }

  table {
    min-width: 420px;
  }
}
