:root { --g9:#16301F; --g7:#2D5A3D; --g1:#E4ECE3; --mari:#E9A21B; --lat:#B5452A; --ink:#18221B; --muted:#5B6A60; --line:#D6DCD3; --bg:#F3F5F1; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--g7); }
:focus-visible { outline: 3px solid var(--mari); outline-offset: 2px; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .8rem; }
code { background: var(--g1); padding: .1em .35em; border-radius: 3px; }
.muted { color: var(--muted); }
.bad { color: var(--lat); font-weight: 600; }

.a-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; background: var(--g9); color: #fff; padding: .6rem 1.5rem; position: sticky; top: 0; z-index: 10; }
.a-brand { color: #fff; font-weight: 700; text-decoration: none; }
.a-brand span { background: var(--mari); color: var(--ink); font-size: .75rem; padding: .1rem .4rem; border-radius: 3px; margin-left: .3rem; }
.a-nav { display: flex; flex-wrap: wrap; gap: .2rem; flex: 1; }
.a-nav a { color: #fff; text-decoration: none; padding: .45rem .7rem; border-radius: 4px; }
.a-nav a:hover { background: rgba(255,255,255,.12); }
.a-nav a[aria-current="page"] { background: rgba(255,255,255,.18); box-shadow: inset 0 -2px 0 var(--mari); }
.a-user { display: flex; gap: 1rem; align-items: center; }
.a-user a, .linkish { color: #fff; background: none; border: 0; font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.a-user form { margin: 0; }
.a-main { padding: 1.5rem; max-width: 1500px; margin: 0 auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: .45rem 1rem; background: var(--g9); color: #fff; border: 2px solid var(--g9); border-radius: 4px; font: 600 .95rem/1 inherit; font-family: inherit; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--g7); border-color: var(--g7); color: #fff; }
.btn-ghost { background: #fff; color: var(--g9); }
.btn-ghost:hover { background: var(--g1); color: var(--g9); }
.btn-small { min-height: 32px; padding: .3rem .7rem; font-size: .85rem; }
.btn-danger { background: #fff; color: var(--lat); border-color: var(--lat); }
.btn-danger:hover { background: var(--lat); color: #fff; border-color: var(--lat); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: 1.2rem 0; }

input, select, textarea { font: inherit; color: inherit; padding: .5rem .6rem; border: 1px solid #B9C3BC; border-radius: 4px; background: #fff; min-height: 38px; }
textarea { width: 100%; }
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: .5rem; }
label.check input { min-height: 0; width: 18px; height: 18px; accent-color: var(--g9); }

.notice { padding: .75rem 1rem; border-radius: 4px; margin: 0 0 1rem; border-left: 4px solid; background: #fff; }
.notice.ok { border-color: var(--g7); background: #EAF4EC; }
.notice.warn { border-color: var(--mari); background: #FFF6E0; }
.notice.err { border-color: var(--lat); background: #FBE9E5; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .9rem 1rem; }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat strong { font-size: 1.9rem; line-height: 1.2; }
.stat strong a { color: inherit; text-decoration: none; }
.stat.attn { border-left: 4px solid var(--mari); }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; }
.data th, .data td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.data th { background: #EEF1EB; font-weight: 600; position: sticky; top: 0; }
.data tbody tr:hover { background: #FAFBF8; }
.data details summary { cursor: pointer; color: var(--g7); font-weight: 600; }
.mini { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; margin: .5rem 0 0; white-space: normal; min-width: 260px; }
.mini dt { color: var(--muted); } .mini dd { margin: 0; }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.tag-paid { background: #DDEFE0; color: #1E5A2E; } .tag-pending { background: #FFF0CC; color: #7A5300; } .tag-waived { background: #E6E9F3; color: #2F3D66; }
.row-actions { display: flex; gap: .5rem; } .row-actions form { margin: 0; }

.filters, .inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem; margin-bottom: 1rem; background: #fff; padding: 1rem; border: 1px solid var(--line); border-radius: 6px; }
.filters label:first-child { flex: 1 1 260px; }
.bulk { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 .7rem; }
.confirm-del { width: 190px; }
.pager { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: 1rem; }
.pager a { padding: .3rem .7rem; border: 1px solid var(--line); background: #fff; border-radius: 4px; text-decoration: none; }
.pager a[aria-current] { background: var(--g9); color: #fff; }

.page-form { display: flex; flex-direction: column; gap: 1rem; max-width: 1000px; }
.page-form input { width: 100%; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.thumb { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; }
.thumb form { margin: 0; }
.upload-box { border-style: dashed; }
.sponsor-edit { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .8rem; margin-bottom: .8rem; }
.sponsor-edit img, .no-logo { width: 110px; height: 70px; object-fit: contain; display: grid; place-items: center; background: var(--bg); border-radius: 4px; color: var(--muted); font-size: .8rem; }
.sponsor-edit .inline-form { border: 0; padding: 0; margin: 0; flex: 1; }
.sponsor-edit > form:last-child { margin: 0; }

.settings-form { max-width: 900px; }
.settings-form fieldset { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.2rem 1.2rem; margin: 0 0 1.2rem; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.2rem; }
.settings-form legend { font-weight: 700; font-size: 1.05rem; padding: 0 .4rem; }
.settings-form label:has(textarea) { grid-column: 1 / -1; }
.settings-form input { width: 100%; }
.hero-preview { grid-column: 1 / -1; max-width: 420px; border-radius: 4px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: .8rem 0; margin: 0; }
@media (max-width: 700px) { .settings-form fieldset { grid-template-columns: 1fr; } }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.card-form { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.card-form h2 { margin: 0; }

body.auth { display: grid; place-items: center; min-height: 100vh; background: var(--g9); padding: 1rem; }
.auth-card { background: #fff; border-radius: 8px; padding: 2rem; width: min(100%, 400px); }
.auth-card form { display: flex; flex-direction: column; gap: .9rem; margin: 1rem 0; }
.auth-card input { width: 100%; }

.img-setting { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.img-setting:last-child { border-bottom: 0; }
.img-setting .hero-preview { max-height: 120px; width: auto; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
h3 { font-size: 1rem; }
