:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #5f6b7a;
  --border: #dde3ec;
  --primary: #0b6bcb;
  --primary-dark: #085296;
  --danger: #b42318;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav a:hover {
  background: #eef2f8;
}

main {
  flex: 1;
  padding: 28px 0 40px;
}

.page-head {
  margin-bottom: 20px;
}

h1,
h2 {
  margin-top: 0;
}

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.15rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.form label {
  font-size: 0.9rem;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(11, 107, 203, 0.25);
  border-color: var(--primary);
}

textarea {
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.inline-form input[name="receipt"] {
  width: 180px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.checkbox input {
  width: auto;
}

.flash {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.flash p {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge {
  display: inline-block;
  background: #eef2f8;
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.action-details {
  margin-bottom: 8px;
}

.action-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}

.action-details .form {
  max-width: 420px;
  margin-top: 10px;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-list li {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.event-list pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.8rem;
  max-height: 180px;
  overflow: auto;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-card {
  max-width: 430px;
  margin: 40px auto;
}

@media (max-width: 760px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .header-inner {
    justify-content: center;
  }

  .auth-card {
    margin-top: 10px;
  }
}

.product-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.product-list li:last-child {
  border-bottom: 0;
}