/* MLW League Office — admin styles (same system as the public site) */
:root {
  --bg: #faf9f7;
  --surface: #fff;
  --surface2: #f3f2ee;
  --line: #e0ded6;
  --line2: #e9e7e0;
  --navy: #0c1b45;
  --blue: #1b3fd1;
  --red: #c01327;
  --ink: #16181d;
  --dim: #565d6b;
  --dim2: #8a8f9b;
  --green: #1f7a4a;
  --disp: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .disp { font-family: var(--disp); font-weight: 600; line-height: 1.05; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.boot { padding: 60px 20px; text-align: center; color: var(--dim2); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* masthead */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; border-bottom: 3px solid var(--red); }
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 32px; height: 32px; border-radius: 7px; }
.brand b { font-family: var(--disp); font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: 0.04em; display: block; line-height: 1; }
.brand small { display: block; font-size: 8.5px; font-weight: 600; letter-spacing: 0.28em; color: #93a2cf; text-transform: uppercase; }
nav.tabs { display: flex; gap: 2px; margin-left: auto; }
nav.tabs button {
  background: none; border: none; color: #a7b4dd;
  font-family: var(--disp); font-weight: 600; font-size: 15px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 18px 11px 15px; border-bottom: 2px solid transparent;
}
nav.tabs button:hover { color: #fff; }
nav.tabs button.on { color: #fff; border-bottom-color: #fff; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.top-actions a, .top-actions button {
  background: none; border: 1px solid rgba(255,255,255,0.3); color: #fff; border-radius: 5px;
  font-size: 12.5px; font-weight: 600; padding: 6px 10px;
}
.top-actions a:hover, .top-actions button:hover { border-color: rgba(255,255,255,0.65); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; border-top: 4px solid var(--red); }
.login-card img { width: 52px; height: 52px; border-radius: 10px; margin-bottom: 12px; }
.login-card h1 { font-size: 30px; text-transform: uppercase; }
.login-card p { color: var(--dim2); font-size: 13px; margin: 6px 0 18px; }
.login-card input { width: 100%; }
.login-card .err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* content */
main.wrap { padding-top: 26px; padding-bottom: 70px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); position: relative; }
.sec-head::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 52px; height: 2px; background: linear-gradient(90deg, var(--blue) 0 50%, var(--red) 50% 100%); }
.sec-head h2 { font-size: 22px; text-transform: uppercase; letter-spacing: 0.05em; }
.sec-head .note { font-size: 12.5px; color: var(--dim2); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }

/* inputs */
input, select {
  font-family: var(--body); font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px;
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
input.num { width: 58px; text-align: right; font-variant-numeric: tabular-nums; }
input.tiny { width: 46px; text-align: center; }
input.wide { width: 100%; }
input[type="color"] { padding: 2px; width: 44px; height: 34px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim2); }

.btn { display: inline-flex; align-items: center; gap: 7px; font-family: var(--disp); font-weight: 600; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 15px; border-radius: 5px; border: 1px solid transparent; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: #a90f21; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.blue:hover { background: #2b52ec; }
.btn.line { border-color: #c9c6bc; background: #fff; color: var(--ink); }
.btn.line:hover { border-color: var(--ink); }
.btn.saved { background: var(--green) !important; color: #fff; }
.btn:disabled { opacity: 0.55; cursor: default; }
.xbtn { background: none; border: none; color: var(--dim2); font-size: 15px; padding: 4px 7px; border-radius: 4px; }
.xbtn:hover { color: var(--red); background: #f7e9eb; }

/* scoreboard */
.day-card { margin-bottom: 12px; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface2); }
.day-head b { font-family: var(--disp); font-weight: 600; font-size: 16px; letter-spacing: 0.05em; text-transform: uppercase; }
.day-head span { color: var(--dim2); font-size: 12px; }
.game-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.game-row:last-child { border-bottom: none; }
.game-row .team { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; width: 150px; }
.game-row .team.right { justify-content: flex-end; text-align: right; }
.game-row img.lg { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; object-fit: cover; }
.game-row .hl { flex: 1; min-width: 200px; }
.game-row .dash { color: var(--dim2); font-weight: 700; }
.badge-status { font-family: var(--disp); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line); color: var(--dim); }
.badge-status.final { background: var(--red); border-color: var(--red); color: #fff; }

.addbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px; }

/* rosters */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.fchip { background: var(--surface); border: 1px solid var(--line); color: var(--dim); font-family: var(--disp); font-weight: 600; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; padding: 6px 12px; border-radius: 4px; display: inline-flex; align-items: center; gap: 7px; }
.fchip img { width: 18px; height: 18px; border-radius: 50%; }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tbl-scroll { overflow-x: auto; }
table.adm { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.adm th { font-family: var(--disp); font-weight: 600; font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim2); text-align: center; padding: 9px 5px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
table.adm th.l { text-align: left; padding-left: 12px; }
table.adm td { padding: 7px 5px; border-bottom: 1px solid var(--line2); text-align: center; white-space: nowrap; }
table.adm td.l { text-align: left; padding-left: 12px; }
table.adm tr:last-child td { border-bottom: none; }
table.adm .rate { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--dim); width: 52px; }
table.adm input.pname { width: 150px; font-weight: 600; }

/* teams */
.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tcard { padding: 16px; border-top: 4px solid var(--c1, var(--blue)); display: flex; flex-direction: column; gap: 10px; }
.tcard .row1 { display: flex; align-items: center; gap: 10px; }
.tcard img { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); }
.tcard .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tcard .tlogo { position: relative; flex: none; cursor: pointer; line-height: 0; border-radius: 50%; }
.tcard .tlogo .tlogo-edit {
  position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px;
  display: grid; place-items: center; font-size: 11px; line-height: 1;
  background: #fff; border: 1px solid var(--line); border-radius: 50%; opacity: 0;
}
.tcard .tlogo:hover .tlogo-edit, .tcard .tlogo:focus-visible .tlogo-edit { opacity: 1; }
.tcard .tlogo:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.tcard .tlogo.drop img { border: 2px dashed #2563eb; }
.tcard.busy { opacity: .5; pointer-events: none; }

/* settings */
.setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.panel-pad { padding: 16px; }
.hint { font-size: 12.5px; color: var(--dim2); line-height: 1.55; }

/* analytics */
.stat-card { display: flex; flex-direction: column; gap: 4px; }
.stat-card span { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim2); }
.stat-card b { font-family: var(--disp); font-weight: 700; font-size: 30px; line-height: 1; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.chart .bar { flex: 1; background: var(--blue); border-radius: 2px 2px 0 0; min-height: 2px; opacity: 0.85; }
.chart .bar:hover { opacity: 1; background: var(--red); }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim2); margin-top: 6px; }

/* news editor */
.news-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.news-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.news-form label.f { margin-bottom: 12px; }
textarea { font-family: var(--body); font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 8px 9px; resize: vertical; width: 100%; }
textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; }
.news-preview { position: sticky; top: 74px; overflow: hidden; }
.news-preview-head { padding: 9px 14px; border-bottom: 1px solid var(--line2); background: var(--surface2); font-family: var(--disp); font-weight: 600; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim2); }
.article-preview { padding: 18px; max-height: 72vh; overflow-y: auto; }
.article-preview .pv-cover { width: 100%; border-radius: 6px; margin-bottom: 12px; }
.article-preview .pv-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--red); text-transform: uppercase; }
.article-preview .pv-title { font-family: var(--disp); font-weight: 700; font-size: 30px; text-transform: uppercase; line-height: 1.03; margin: 5px 0 6px; }
.article-preview .pv-meta { color: var(--dim2); font-size: 12.5px; font-weight: 600; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 14px; }
.article-preview .article-body { font-size: 15px; line-height: 1.65; color: #23262e; }
.article-preview .article-body h2 { font-family: var(--disp); font-size: 21px; text-transform: uppercase; margin: 18px 0 7px; }
.article-preview .article-body h3 { font-family: var(--disp); font-size: 18px; text-transform: uppercase; margin: 15px 0 6px; }
.article-preview .article-body p { margin: 0 0 14px; }
.article-preview .article-body ul, .article-preview .article-body ol { margin: 0 0 14px 20px; }
.article-preview .article-body li { margin-bottom: 5px; }
.article-preview .article-body a { color: var(--blue); text-decoration: underline; }
.article-preview .article-body img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.article-preview .article-body blockquote { border-left: 3px solid var(--red); padding-left: 14px; color: var(--dim); font-style: italic; margin: 0 0 14px; }
.article-preview .article-body code { background: var(--surface2); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; font-size: 0.9em; }
@media (max-width: 800px) { .news-editor { grid-template-columns: 1fr; } .news-preview { position: static; } }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); background: var(--ink); color: #fff; font-weight: 500; font-size: 13.5px; padding: 10px 16px; border-radius: 8px; z-index: 400; opacity: 0; pointer-events: none; transition: 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }

@media (max-width: 760px) {
  nav.tabs { overflow-x: auto; }
  .game-row .team { width: 120px; }
}

/* box score editor */
.box-cols { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 1100px) { .box-cols { grid-template-columns: 1fr 1fr; } }

/* photo insert toolbar + preview figures */
.photo-insert { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; background: #fafbfe; }
.photo-insert .pi-head { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim2); margin-bottom: 8px; }
.photo-insert .pi-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.photo-insert .pi-grid .f { min-width: 150px; flex: 1; }
.article-body { overflow: hidden; }
.article-body figure.ph { margin: 16px auto; }
.article-body figure.ph img { width: 100%; display: block; border-radius: 8px; }
.article-body figure.ph figcaption { font-size: 12px; color: var(--dim2); margin-top: 6px; line-height: 1.4; }
.article-body .ph-center { margin-left: auto; margin-right: auto; }
.article-body .ph-center figcaption { text-align: center; }
.article-body .ph-left { float: left; margin: 4px 16px 10px 0; }
.article-body .ph-right { float: right; margin: 4px 0 10px 16px; }
.article-body .ph-small { width: 32%; }
.article-body .ph-medium { width: 55%; }
.article-body .ph-large { width: 100%; float: none; }

/* ---------- headshots ---------- */
.hint { color: var(--muted, #6b7280); font-size: 13px; margin: 6px 0 12px; }
.hsgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px; margin-top: 14px;
}
.hscard {
  position: relative; text-align: center; cursor: pointer;
  border: 1px solid var(--line, #e5e7eb); border-radius: 10px;
  padding: 12px 10px 14px; background: #fff; transition: border-color .15s, transform .15s;
}
.hscard:hover, .hscard:focus-visible { border-color: #9ca3af; transform: translateY(-1px); outline: none; }
.hscard.drop { border-color: #2563eb; border-style: dashed; background: #eff6ff; }
.hscard.busy { opacity: .5; pointer-events: none; }
.hsimg {
  position: relative; width: 96px; height: 96px; margin: 0 auto 10px;
  border-radius: 50%; overflow: hidden; background: #f3f4f6;
  display: grid; place-items: center;
}
.hsimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hsinit { font-size: 28px; font-weight: 700; color: #9ca3af; letter-spacing: .02em; }
.hsover {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600;
  opacity: 0; transition: opacity .15s;
}
.hscard:hover .hsover, .hscard:focus-visible .hsover { opacity: 1; }
.hscard b { display: block; font-size: 13.5px; line-height: 1.25; }
.hscard small { display: block; font-size: 11.5px; color: #6b7280; }
.hsdel {
  margin-top: 8px; font-size: 11px; padding: 3px 9px; border-radius: 5px;
  border: 1px solid var(--line, #e5e7eb); background: #fff; color: #b91c1c;
}
.hsdel:hover { background: #fef2f2; border-color: #fca5a5; }
