.admin-grid { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; font-weight: 400; font-size: 15px; background: #f3efe8; }
.admin-side { background: var(--ink); color: #d9d0c4; padding: 1.6rem 1.2rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.admin-brand { font-family: var(--serif); font-size: 1.5rem; color: #fff; display: block; line-height: 1.1; }
.admin-brand span { display: block; font-family: var(--sans); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: #9a8c7d; margin-top: .35rem; }
.admin-brand:hover { text-decoration: none; }
.admin-side nav { display: flex; flex-direction: column; gap: .15rem; }
.admin-side nav a { color: #d9d0c4; padding: .55rem .8rem; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.admin-side nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.admin-side nav a.active { background: var(--accent); color: #fff; }
.admin-side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: .4rem; font-size: .85rem; }
.admin-side-bottom a { color: #9a8c7d; }
.badge { background: #e2b24d; color: #2b2622; font-size: .72rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; }
.admin-main { padding: 2rem clamp(1.25rem, 4vw, 3rem) 4rem; max-width: 1200px; }
.admin-main h1 { font-size: 2.2rem; margin-bottom: 1.5rem; }
.admin-main h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.admin-grid .flash { width: auto; margin: 0 0 1.2rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 1.2rem 1.3rem; }
.card .num { font-family: var(--serif); font-size: 2.4rem; line-height: 1; margin-bottom: .3rem; }
.card .lbl { font-size: .85rem; color: var(--muted); }
.card.warn .num { color: #b07a1a; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 1.4rem 1.6rem; margin-bottom: 1.5rem; }
.panel h2 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1.2rem; }
.form-grid .full { grid-column: 1 / -1; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.btn-tiny { padding: .32rem .75rem; font-size: .78rem; }

table.list { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.list th, table.list td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.list th { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: #faf7f2; }
table.list tr:last-child td { border-bottom: 0; }
code.link { font-size: .82rem; background: #f3efe8; padding: .2rem .45rem; border-radius: 4px; word-break: break-all; }

.tag { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.tag-pending { background: #fbeccb; color: #8a5d0f; }
.tag-ok { background: #e1efdd; color: #2f5a2a; }
.tag-off { background: #eee6e3; color: #7f3a31; }
.tag-yes { background: #e1efdd; color: #2f5a2a; }
.tag-no { background: #f3dfdb; color: #7f3028; }

.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.mod-item { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.mod-item.pending { border-color: #e2b24d; box-shadow: 0 0 0 2px #fbeccb; }
.mod-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.mod-body { padding: .9rem 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.mod-meta { font-size: .8rem; color: var(--muted); }
.mod-text { white-space: pre-wrap; font-size: .95rem; max-height: 260px; overflow: auto; }
.mod-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .5rem; }
.filter-bar { display: flex; gap: .5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.filter-bar a { padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); font-size: .85rem; }
.filter-bar a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-bar a:hover { text-decoration: none; }
.help { font-size: .88rem; color: var(--muted); }
.login-box { max-width: 380px; margin: 12vh auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 2.2rem; }
.login-wrap { min-height: 100vh; background: #f3efe8; }

@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
}
