:root {
  color-scheme: light;
  --ink: #211d1a;
  --ink-soft: #4a443f;
  --muted: #857c74;
  --line: #eae5e0;
  --line-strong: #d9d2cb;
  --brand: #bc4515;
  --brand-dark: #9a3810;
  --brand-deep: #7e2e0d;
  --brand-soft: #fdf0e9;
  --brand-tint: #fbe3d6;
  --bg: #f8f6f3;
  --surface: #ffffff;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  --bad-line: #fecdca;
  --good: #067647;
  --good-soft: #ecfdf3;
  --good-line: #abefc6;
  --warn-ink: #93520b;
  --warn-soft: #fffaeb;
  --warn-line: #fedf89;
  --focus: rgba(188, 69, 21, .35);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(33, 29, 26, .05);
  --shadow-sm: 0 1px 2px rgba(33, 29, 26, .05), 0 2px 8px rgba(33, 29, 26, .04);
  --shadow-md: 0 2px 4px rgba(33, 29, 26, .05), 0 8px 24px rgba(33, 29, 26, .07);
  --shadow-lg: 0 4px 8px rgba(33, 29, 26, .06), 0 18px 48px rgba(33, 29, 26, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 50% -100px, rgba(188, 69, 21, .06), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .65rem 1.5rem;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid rgba(33, 29, 26, .08);
}

header form { margin: 0; }

.brand {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  white-space: nowrap;
}

.brand strong { font-size: 1.05rem; letter-spacing: -.015em; }

.brand-mark {
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #d05423, var(--brand-dark));
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), var(--shadow-xs);
}

.main-nav { display: flex; gap: .15rem; flex-wrap: wrap; }

.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: .875rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  transition: background .15s, color .15s;
}

.main-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }

.header-actions { display: flex; align-items: center; gap: .75rem; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .28rem .8rem .28rem .32rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .82rem;
  color: var(--ink-soft);
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.user-chip .avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-tint), var(--brand-soft));
  color: var(--brand-deep);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
}

.user-chip .role { color: var(--muted); text-transform: capitalize; }

/* ---------- Layout ---------- */

main {
  max-width: 1200px;
  margin: 2.25rem auto 5rem;
  padding: 0 1.5rem;
}

.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(188, 69, 21, .09), transparent 60%),
    radial-gradient(700px 500px at 95% 110%, rgba(188, 69, 21, .07), transparent 60%),
    var(--bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.narrow { max-width: 640px; width: 100%; }

/* ---------- Typography ---------- */

h1, h2 {
  line-height: 1.25;
  margin-top: 0;
  letter-spacing: -.02em;
  font-weight: 700;
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.2rem; margin-bottom: .35rem; }
h3 { margin-top: 1.75rem; font-size: 1rem; letter-spacing: -.01em; }

.muted, .hint { color: var(--muted); }
.small, .hint { font-size: .84rem; }
.hint { font-weight: 400; line-height: 1.5; }

.section-sub {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: .9rem;
}

a { color: var(--brand-dark); text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }

/* ---------- Grid helpers ---------- */

.grid { display: grid; gap: 1rem 1.4rem; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inline { display: flex; gap: .5rem; }
.inline input { min-width: 0; }
.filter-row { margin: 0 0 1rem; }
.filter-row label { min-width: 13rem; margin: 0; }
.bulk-toolbar { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; padding: .9rem; margin: 0 0 .35rem; border: 1px solid var(--line); border-radius: var(--radius); background: #faf8f5; }
.bulk-toolbar label { margin: 0; min-width: 10rem; }
.bulk-toolbar input { min-width: 11rem; }
.simple-list { padding-left: 1.2rem; margin: 0 0 1.3rem; color: var(--ink-soft); }
.simple-list li { margin: .35rem 0; }
.api-disclaimer { max-width: 1200px; margin: 0 auto 2rem; padding: 0 1.5rem; color: var(--muted); font-size: .75rem; text-align: center; }

/* ---------- Tables ---------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

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

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

tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fcf9f6; }

th {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: #faf8f5;
  white-space: nowrap;
}

/* ---------- Forms ---------- */

label {
  display: grid;
  gap: .4rem;
  font-weight: 600;
  font-size: .875rem;
  margin-bottom: 1.15rem;
  color: var(--ink-soft);
}

input, textarea, select, button, .button { font: inherit; border-radius: 10px; }

input, textarea, select {
  width: 100%;
  padding: .62rem .75rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(33, 29, 26, .03);
  transition: border-color .15s, box-shadow .15s;
}

input::placeholder, textarea::placeholder { color: #b3aaa1; }

input:hover, textarea:hover, select:hover { border-color: #c8bfb6; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px var(--focus);
}

textarea { resize: vertical; line-height: 1.55; }
select[size] { min-height: 12rem; }

/* ---------- Buttons ---------- */

button, .button {
  display: inline-block;
  border: 0;
  background: linear-gradient(180deg, #ca4d1a, var(--brand-dark));
  color: #fff;
  padding: .62rem 1.15rem;
  text-decoration: none;
  font-weight: 650;
  font-size: .9rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), var(--shadow-xs);
  transition: filter .15s, transform .08s, box-shadow .15s;
}

button:hover, .button:hover { filter: brightness(1.07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), var(--shadow-sm); }
button:active, .button:active { transform: translateY(1px); filter: brightness(.97); }

button.secondary, .button.secondary {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
}

button.secondary:hover, .button.secondary:hover { background: #faf7f4; border-color: #c8bfb6; filter: none; }

button.danger { background: linear-gradient(180deg, #c22f22, #9a1e16); }
button.danger:hover { filter: brightness(1.06); }

.small-button { padding: .38rem .7rem; font-size: .8rem; border-radius: 8px; }

button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

button:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- Alerts & status ---------- */

.alert, .success {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  font-size: .9rem;
  box-shadow: var(--shadow-xs);
}

.alert { background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--bad); }
.success { background: var(--good-soft); border: 1px solid var(--good-line); color: var(--good); }

.dot {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--bad);
  margin-right: .1rem;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, .14);
}

.dot.good { background: var(--good); box-shadow: 0 0 0 3px rgba(6, 118, 71, .14); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .77rem;
  font-weight: 650;
  white-space: nowrap;
  background: #f6f3f0;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}

.pill.good { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
.pill.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.pill.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }

/* ---------- Misc ---------- */

.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

.chip-list form {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .4rem .3rem .85rem;
  background: var(--surface);
  font-size: .85rem;
  box-shadow: var(--shadow-xs);
}

details { margin-top: 1rem; }

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
  padding: .3rem 0;
  transition: color .15s;
}

summary:hover { color: var(--brand-dark); }

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .6rem 1.5rem;
  margin: 1.25rem 0;
}

dt { font-weight: 600; color: var(--muted); font-size: .875rem; }
dd { margin: 0; font-weight: 500; }

.login-card { text-align: center; padding: 2.75rem 2.5rem 2.5rem; border-radius: 20px; box-shadow: var(--shadow-lg); border-color: rgba(33, 29, 26, .06); }
.login-card h1 { margin-bottom: .25rem; }
.login-card form { text-align: left; margin-top: 1.75rem; }
.login-card button { width: 100%; margin-top: .35rem; padding: .72rem 1rem; }
.login-brand { justify-content: center; margin-bottom: 1rem; }
.login-brand .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 1.3rem; }

/* ---------- Responsive ---------- */

@media (max-width: 950px) {
  .main-nav { display: none; }
}

@media (max-width: 850px) {
  .four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .two, .three, .four { grid-template-columns: 1fr; }
  header { padding: .65rem 1rem; flex-wrap: wrap; }
  .header-actions { margin-left: auto; }
  .card { padding: 1.25rem; }
  main { margin-top: 1.25rem; padding: 0 1rem; }
}
/* Private production-art file controls shared by listing drafts and existing listings. */
.print-files { margin-top: 1rem; padding: .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fdfcfa; }
.print-files summary { cursor: pointer; font-weight: 750; }
.print-files h2 { margin: 0 0 .25rem; font-size: 1rem; }
.print-file-list { display: grid; gap: .45rem; margin: .8rem 0; padding: 0; list-style: none; }
.print-file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.print-file-list form { display: inline; margin: 0; }
