/* Blazers staff portal */
:root {
  --ink: #1d1b19;
  --ink-2: #4a4642;
  --muted: #6b665f;
  --line: #e2ddd5;
  --bg: #f6f3ee;
  --panel: #ffffff;
  --red: #b3221a;
  --red-dark: #8e1a13;
  --gold: #f5a800;
  --night: #121110;
  --ok-bg: #e5f4ec;   --ok: #1d6b45;
  --warn-bg: #fff3d6; --warn: #7a5300;
  --bad-bg: #fbe4e2;  --bad: #9b1c14;
  --info-bg: #e8eef8; --info: #23477a;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Ubuntu, Cantarell, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; font-size: 16px; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1 { font-size: 1.6rem; margin: 0 0 0.5rem; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
small, .muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Top bar and navigation */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--night); color: #fff; padding: 0.6rem 1rem; border-bottom: 3px solid var(--red);
}
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: 0.02em; display: flex; align-items: center; gap: 0.5rem; }
.brand:hover { color: #fff; }
.brand-mark {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 6px;
  background: var(--red); color: #fff; border: 2px solid var(--gold); font-weight: 800;
}
.who { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; flex-wrap: wrap; }
.who-role { background: rgba(255,255,255,0.12); padding: 0.1rem 0.5rem; border-radius: 99px; font-size: 0.8rem; }
.who-out { color: #fff; }
.who-out:hover { color: var(--gold); }

.mainnav {
  display: flex; gap: 0.25rem; overflow-x: auto; background: var(--panel);
  border-bottom: 1px solid var(--line); padding: 0 0.5rem; -webkit-overflow-scrolling: touch;
}
.mainnav a {
  flex: none; padding: 0.75rem 0.8rem; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  border-bottom: 3px solid transparent; min-height: 44px; display: flex; align-items: center;
}
.mainnav a:hover { color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--red); border-bottom-color: var(--red); }
.mainnav .nav-site { margin-left: auto; color: var(--muted); font-weight: 500; }

/* Layout */
.wrap { max-width: 1040px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.wrap-narrow { max-width: 560px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.page-head h1 { margin: 0; }
.intro { color: var(--ink-2); margin: 0 0 1rem; max-width: 70ch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.card p { margin: 0.25rem 0; }
.card .big { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.card-alert { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.activity li { font-size: 0.92rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; padding: 0.55rem 1.1rem; border-radius: 8px; border: 2px solid var(--red);
  background: var(--red); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); border-color: var(--ink-2); }
.btn-small { min-height: 36px; padding: 0.3rem 0.8rem; font-size: 0.9rem; }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* Filters */
.filters { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters a {
  padding: 0.35rem 0.9rem; border-radius: 99px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.9rem; min-height: 36px; display: inline-flex; align-items: center;
}
.filters a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Tables (cards on narrow screens) */
table.data { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #faf8f4; }
table.data tr:last-child td { border-bottom: 0; }
.row-actions { text-align: right; white-space: nowrap; }
.thumb { max-width: 90px; max-height: 40px; object-fit: contain; display: block; }

@media (max-width: 720px) {
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data thead { display: none; }
  table.data { background: transparent; border: 0; }
  table.data tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 0.75rem; padding: 0.4rem 0.2rem; }
  table.data td { border: 0; padding: 0.3rem 0.8rem; }
  table.data td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
  .row-actions { text-align: left; }
  .row-actions .btn { width: 100%; }
  .mainnav .nav-site { margin-left: 0; }
}

/* Tags */
.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 99px; background: var(--bg); color: var(--ink-2); vertical-align: middle; }
.tag-home { background: var(--ok-bg); color: var(--ok); }
.tag-away { background: var(--info-bg); color: var(--info); }
.tag-final, .tag-published { background: var(--ok-bg); color: var(--ok); }
.tag-scheduled, .tag-draft { background: var(--info-bg); color: var(--info); }
.tag-postponed, .tag-featured { background: var(--warn-bg); color: var(--warn); }
.tag-cancelled { background: var(--bad-bg); color: var(--bad); }

/* Forms */
.form { max-width: 720px; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field .req { color: var(--red); }
.field input[type="text"], .field input[type="email"], .field input[type="url"], .field input[type="number"], .field input[type="password"],
.field input[type="date"], .field input[type="datetime-local"], .field select, .field textarea {
  width: 100%; font: inherit; padding: 0.6rem 0.7rem; border: 1px solid #c9c3b9; border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px;
}
.field input[type="number"] { max-width: 10rem; }
.field textarea { resize: vertical; }
.field input[type="file"] { font: inherit; }
.field .help { margin: 0.3rem 0 0; font-size: 0.88rem; color: var(--muted); }
.field .error { margin: 0.3rem 0 0; font-size: 0.9rem; color: var(--bad); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; min-height: 44px; cursor: pointer; }
label.check input { width: 1.2rem; height: 1.2rem; }
.image-current { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.image-current img { max-width: 200px; max-height: 80px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.image-current label.check { font-weight: 500; }

/* Flash messages */
.flash { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }

/* Message view */
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0 0 1rem; }
dl.meta dt { font-weight: 600; color: var(--muted); }
dl.meta dd { margin: 0; }
.message-body { white-space: normal; background: #faf8f4; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--ink-2); }
.changes li { font-size: 0.85rem; overflow-wrap: anywhere; }

/* Sign-in */
.signin { max-width: 440px; margin: 2rem auto; }
.signin h1 { margin-bottom: 0.75rem; }
.btn-wide { width: 100%; }
.code-input { font-size: 1.6rem !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.who-out-form { display: inline; margin: 0; }
button.who-out { background: none; border: 0; padding: 0; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; min-height: 32px; }
button.who-out:hover { color: var(--gold); }

/* Inbox replies */
.reply-sent { border-left: 4px solid var(--ok); }
.reply-meta { margin: 0 0 0.6rem; font-size: 0.92rem; color: var(--ink-2); }
#reply h2 { margin-bottom: 0.75rem; }
#reply textarea { min-height: 14rem; }
.reply-in { border-left: 4px solid var(--info); }
details.quoted { margin-top: 0.6rem; }
details.quoted .message-body { margin-top: 0.5rem; color: var(--ink-2); font-size: 0.92rem; }
.attach-note { margin: 0.6rem 0 0; font-size: 0.92rem; color: var(--ink-2); }

/* Unread conversations */
tr.unread td { font-weight: 700; color: var(--ink); }
tr.unread td small { font-weight: 600; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-right: 0.45rem; vertical-align: middle; }
.nav-count { display: inline-block; min-width: 1.35rem; padding: 0 0.35rem; margin-left: 0.35rem; border-radius: 99px; background: var(--red); color: #fff; font-size: 0.75rem; line-height: 1.35rem; text-align: center; }
details.advanced { margin: 0.5rem 0 1rem; }
details.advanced summary { cursor: pointer; font-weight: 600; color: var(--ink-2); margin-bottom: 0.75rem; }

/* Inbox header buttons */
.head-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.inline-action { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.25rem; max-width: 720px; }

/* Section headings inside long forms */
.form-section { font-size: 1.05rem; margin: 1.75rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.form-section:first-of-type { margin-top: 0.25rem; padding-top: 0; border-top: none; }
.image-current img { max-height: 140px; }
.brand-logo { height: 30px; width: auto; display: block; }
