/* Archivo (SIL Open Font License), self-hosted: no Google Fonts requests */
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations"), url(../fonts/archivo-latin-wdth-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2-variations"), url(../fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --black: #000; --ink: #16181b; --mute: #60676e; --line: #dde1e4; --bg: #eef0f1; --white: #fff;
  --flame: #ee4a12; --amber: #ffb51c; --wa: #25d366; --wa-ink: #052e16; --danger: #b42318;
  --heat-h: linear-gradient(90deg, #ee4a12, #ff8a1f 55%, #ffb51c);
  --r: 8px; --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0 0 16px; line-height: 1.15; font-stretch: 115%; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.05rem; }
.mt { margin-top: 28px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.ico { width: 1.15em; height: 1.15em; flex: none; }
small, .hint { color: var(--mute); font-size: .875rem; font-weight: 400; }
p.hint { margin: 8px 0 0; }

.a-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.a-header { background: var(--black); color: var(--white); position: sticky; top: 0; z-index: 10; }
.a-header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.a-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.a-brand img { height: 38px; width: auto; }
.a-brand span { font-weight: 700; color: var(--amber); font-size: .9rem; }
.a-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.a-nav a { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: #cfd4d8; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.a-nav a:hover { color: var(--white); background: #16181b; }
.a-nav a[aria-current] { color: var(--white); box-shadow: inset 0 -2px 0 var(--amber); }
.badge { background: var(--flame); color: var(--white); font-size: .75rem; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; }
.a-user { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: .9rem; }
.a-user a { color: #cfd4d8; }
.a-user form { margin: 0; }
.linkbtn { background: none; border: 0; color: #cfd4d8; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.a-main { padding-top: 28px; padding-bottom: 64px; }
.back { font-weight: 600; text-decoration: none; }
.back::before { content: "‹ "; }

.panel { background: var(--white); border-radius: var(--r); padding: clamp(18px, 3vw, 32px); margin-bottom: 24px; box-shadow: 0 1px 0 var(--line); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h1, .panel-head h2 { margin: 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--black); color: var(--white); border-radius: var(--r); padding: 18px 22px; text-decoration: none; display: flex; flex-direction: column; }
.stat strong { font-size: 2rem; font-stretch: 125%; font-weight: 850; line-height: 1.1; }
.stat span { color: #a4abb2; font-size: .9rem; }
.stat-hot strong { color: var(--amber); }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-weight: 550; }
.alert-ok { background: #e3f8eb; color: #0b5a2b; border-left: 4px solid var(--wa); }
.alert-error { background: #fdeae3; color: #8c2a07; border-left: 4px solid var(--flame); }

.form { display: grid; gap: 16px; }
.form label { display: block; font-weight: 600; font-size: .9375rem; }
.form label > input:not([type=checkbox]), .form label > select, .form label > textarea { display: block; margin-top: 6px; }
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid #c6ccd1; border-radius: 6px; font: inherit; font-weight: 400; background: var(--white);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(238,74,18,.18); }
.form .check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.form .check input { width: 18px; height: 18px; accent-color: var(--flame); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.align-start { align-items: start; }
.label { font-weight: 700; margin: 0 0 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 6px; border: 1.5px solid #c6ccd1; background: var(--white); color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; }
.btn-primary { background: var(--heat-h); color: var(--black); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }
.btn-wa { background: var(--wa); color: var(--wa-ink); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #f0c7c2; }
.btn-danger:hover { border-color: var(--danger); }
.btn-danger.confirming { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.iconbtn { width: 36px; height: 36px; display: grid; place-items: center; border: 1.5px solid #d3d8dc; border-radius: 6px; background: var(--white); cursor: pointer; color: var(--ink); }
.iconbtn:hover:not([disabled]) { border-color: var(--ink); }
.iconbtn[disabled] { opacity: .3; cursor: default; }
.iconbtn.on { color: var(--flame); border-color: var(--flame); }

/* Upload */
.tabs { display: inline-flex; background: var(--bg); padding: 4px; border-radius: 8px; margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 8px 16px; border-radius: 6px; font: inherit; font-weight: 650; cursor: pointer; color: var(--mute); }
.tabs button[aria-selected=true] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.drop { position: relative; display: grid !important; place-items: center; text-align: center; gap: 4px; padding: 36px 20px; border: 2px dashed #c0c6cb; border-radius: var(--r); background: #fafbfb; cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.is-over { border-color: var(--flame); background: #fff6f1; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { font-size: 1.05rem; }
.drop span { color: var(--mute); font-weight: 400; font-size: .9rem; }
.drop-sm { padding: 24px 16px; min-height: 180px; }
.drop-preview { max-height: 160px; border-radius: 6px; margin-top: 8px; }
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.previews:empty { display: none; }
.previews img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; width: 100%; }
.upload-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-actions form { margin: 0; }
.progress { flex: 1; min-width: 160px; height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--heat-h); transition: width .2s; }

/* Gallery admin tiles */
.inline-filter select { min-height: 38px; padding: 6px 10px; border-radius: 6px; border: 1.5px solid #c6ccd1; font: inherit; }
.a-tiles { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.a-tile { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.a-tile.is-featured { border-color: var(--flame); box-shadow: 0 0 0 1px var(--flame); }
.a-thumb { position: relative; aspect-ratio: 4/3; background: var(--bg); }
.a-thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-thumb-before { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.a-thumb-before + .pill::before { content: ""; }
.pill { position: absolute; left: 8px; bottom: 8px; background: var(--black); color: var(--white); font-size: .75rem; font-weight: 650; padding: 3px 8px; border-radius: 4px; }
.pill-hot { left: auto; right: 8px; top: 8px; bottom: auto; background: var(--flame); }
.a-tile-body { padding: 12px 14px 4px; display: flex; flex-direction: column; flex: 1; }
.a-tile-body span { color: var(--mute); font-size: .875rem; }
.a-tile-actions { display: flex; gap: 6px; padding: 10px 14px 14px; flex-wrap: wrap; align-items: center; }
.a-tile-actions form { margin: 0; }
.a-tile-actions .btn-sm { min-height: 36px; }
.empty-note { color: var(--mute); padding: 24px; border: 2px dashed var(--line); border-radius: var(--r); text-align: center; margin: 0; }
.edit-img { border-radius: 6px; max-height: 260px; margin-bottom: 10px; }
.file { margin-top: 8px; }
.file input { font-weight: 400; }

/* Messages */
.msg-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.msg-list li { border-bottom: 1px solid var(--line); }
.msg-list a { display: grid; grid-template-columns: 220px 1fr auto; gap: 16px; padding: 14px 8px; text-decoration: none; align-items: baseline; }
.msg-list a:hover { background: #f7f8f8; }
.msg-who { display: flex; flex-direction: column; }
.msg-who strong { font-weight: 600; }
.msg-who em { font-style: normal; font-size: .8125rem; color: var(--mute); }
.msg-preview { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-list time { color: var(--mute); font-size: .875rem; }
.msg-list .unread a { background: #fff8f3; }
.msg-list .unread strong { font-weight: 800; }
.msg-list .unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--flame); margin-right: 8px; vertical-align: middle; }
.msg-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 20px; }
.msg-meta dt { color: var(--mute); font-size: .8125rem; }
.msg-meta dd { margin: 0; font-weight: 600; word-break: break-word; }
.msg-body { background: var(--bg); border-radius: 6px; padding: 18px 20px; margin-bottom: 20px; white-space: normal; font-size: 1.05rem; }

/* Reviews / admins lists */
.review-admin { list-style: none; margin: 0; padding: 0; }
.review-admin li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.review-admin p { margin: 4px 0 0; }
.review-admin form { margin: 0; }
.row-actions { display: flex; gap: 6px; flex: none; }
.hidden-row { opacity: .55; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--black); padding: 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border-radius: 12px; padding: 32px; }
.auth-logo { width: 100%; border-radius: 6px; margin-bottom: 24px; }
.auth-foot { text-align: center; margin: 20px 0 0; font-size: .9rem; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; }
.checks li::before { display: inline-block; width: 1.4em; font-weight: 800; }
.checks .ok::before { content: "✓"; color: #12813d; }
.checks .bad::before { content: "✕"; color: var(--danger); }
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .pair-grid, .msg-meta { grid-template-columns: 1fr; }
  .msg-list a { grid-template-columns: 1fr auto; }
  .msg-preview { grid-column: 1 / -1; grid-row: 2; }
  .a-user { margin-left: 0; width: 100%; padding-bottom: 10px; }
}
