:root {
  --ink: #1c2430;
  --ink-soft: #55606f;
  --line: #dfe4ea;
  --bg: #f6f7f9;
  --card: #ffffff;
  --brand: #b3141e;
  --brand-dark: #8c0f17;
  --ok-bg: #e7f6ec;
  --ok-ink: #1a7a3c;
  --err-bg: #fdecea;
  --err-ink: #b3261e;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--ink);
  color: white;
  flex-wrap: wrap;
}
.topbar .brand { color: white; font-weight: 700; font-size: 1.2rem; letter-spacing: 0.02em; }
.topbar a { color: rgba(255,255,255,0.85); }
.topnav { display: flex; gap: 16px; flex-wrap: wrap; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 0.9rem; color: rgba(255,255,255,0.75); }

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #2b1a00;
  color: #ffd68a;
  padding: 10px 24px;
  font-size: 0.88rem;
}
.impersonation-banner button { background: #ffd68a; color: #2b1a00; }
.impersonation-banner button:hover { background: #ffc659; }

.page { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

h1 { font-size: 1.6rem; margin: 0 0 6px; }
h2 { font-size: 1.2rem; margin: 28px 0 12px; }
.subtitle { color: var(--ink-soft); margin: 0 0 24px; }

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

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.tile img { width: 100%; height: 160px; object-fit: contain; display: block; background: #eee; }
.tile .tile-body { padding: 12px 14px; }
.tile .tile-title { font-weight: 600; }
.tile .tile-meta { color: var(--ink-soft); font-size: 0.85rem; }

.action-banner {
  background: #fff7e6;
  border: 1px solid #f2c94c;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.action-banner h2 { margin-top: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--ink-soft); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #eef1f5;
  color: var(--ink-soft);
}
.badge-proof_ready, .badge-queued { background: #fff2cc; color: #8a6d1a; }
.badge-approved, .badge-production_ready, .badge-printed, .badge-complete { background: var(--ok-bg); color: var(--ok-ink); }
.badge-changes_requested, .badge-failed, .badge-reprint_required { background: var(--err-bg); color: var(--err-ink); }

form { max-width: 560px; }
.field { margin-bottom: 14px; }
.field-label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
.field-input,
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
}
textarea { min-height: 90px; }
.field ul { list-style: none; margin: 0; padding: 0; }
.field-error .field-input, .field-error input, .field-error select, .field-error textarea { border-color: var(--err-ink); }
.field-errors { color: var(--err-ink); font-size: 0.82rem; margin-top: 4px; }

/* Any clickable action -- whether a <button>/<input type=submit> or an <a>
   standing in for one -- gets real button chrome. Plain <a> tags stay plain
   only for genuine navigation (breadcrumbs, pagination). */
.btn, button, input[type=submit] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
}
.btn:hover, button:hover, input[type=submit]:hover { background: var(--brand-dark); color: white; text-decoration: none; }
.btn-secondary { background: #eef1f5; color: var(--ink); }
.btn-secondary:hover { background: #dfe4ea; color: var(--ink); }
.btn-danger { background: var(--err-ink); color: white; }
.btn-danger:hover { background: #8c1a14; color: white; }
.btn-sm { padding: 6px 12px; font-size: 0.84rem; }

.flash-stack { margin-bottom: 20px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 0.92rem; }
.flash-success { background: var(--ok-bg); color: var(--ok-ink); }
.flash-error { background: var(--err-bg); color: var(--err-ink); }

.two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

.preview-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #eee; }
.preview-frame img { width: 100%; display: block; }

.muted { color: var(--ink-soft); }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
