/* Hallmark: operate-utility | direction: crisp-stone-ink */
:root {
  --bg: #f6f6f3;
  --surface: #fcfcfa;
  --surface-alt: #f0efe9;
  --ink: #1b1b18;
  --muted: #58574f;
  --border: #d8d6cc;
  --accent: #3f2414;
  --accent-ink: #fdfcf7;
  --accent-soft: #f5c400;
  --success: #166534;
  --danger: #991b1b;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px;
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 12px;
  height: 12px;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 16px;
  font-size: 15px;
}

.nav-links a[aria-current="page"] {
  font-weight: 700;
  color: var(--ink);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  max-width: 68ch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.3;
  text-wrap: balance;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .form-grid-two {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding-top: 8px;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled,
input:disabled {
  background: var(--surface-alt);
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn-sm {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 14px;
}

.alert {
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  margin-top: 16px;
  font-size: 14px;
}

.alert-ok {
  border-color: var(--success);
  color: var(--success);
}

.alert-err {
  border-color: var(--danger);
  color: var(--danger);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-alt);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.badge-active {
  color: var(--success);
  border-color: var(--success);
}

.badge-pending {
  color: var(--accent);
  border-color: var(--accent);
}

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

.hidden {
  display: none;
}

.field select {
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
}

.pos-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.pos-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  background: var(--surface);
  color: var(--accent);
}

.pos-dot.filled {
  background: var(--accent-soft);
}

.pos-badge-gift {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.pos-video {
  width: 100%;
  border-radius: 8px;
  margin-top: 12px;
  max-height: 220px;
  object-fit: cover;
}

.btn-nowrap {
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
  }
}
