body.admin { background: var(--blue-50); min-height: 100vh; }

/* login */
.login-view { position: relative; min-height: 100vh; display: grid; place-items: center; background: var(--blue); padding: 24px; overflow: hidden; }
.login-view[hidden], #app-view[hidden] { display: none; }
.login-card { position: relative; width: min(420px, 100%); background: #fff; border-radius: 20px; padding: 32px; box-shadow: 0 30px 60px rgba(9, 30, 48, .4); }
.login-logo { border-radius: 12px; margin-bottom: 20px; }
.login-card h1 { font-size: 1.5rem; }
.login-card .btn { width: 100%; }
.login-rp { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; padding: 14px; border-radius: 12px; background: var(--rp-charcoal); color: var(--rp-cream); text-decoration: none; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.login-rp img { height: 24px; width: auto; }
.login-rp:hover { background: #1f1f1f; }
.back-link { display: block; text-align: center; margin-top: 14px; font-size: .9rem; }

/* bar */
.admin-bar { background: var(--blue); box-shadow: 0 2px 0 var(--gold); position: sticky; top: 0; z-index: 20; }
.admin-bar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 66px; gap: 12px; flex-wrap: wrap; }
.admin-bar-right { display: flex; align-items: center; gap: 14px; color: #fff; }
.admin-bar-right .btn { color: #fff; }
.who { font-size: .9rem; opacity: .9; }

.admin-main { padding: 28px 0 60px; }
.rp-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: var(--rp-charcoal); color: var(--rp-cream); border-radius: 18px; padding: 28px 32px; text-decoration: none; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); transition: transform .15s; }
.rp-hero:hover { transform: translateY(-2px); }
.rp-hero-logo { display: block; height: 48px; width: auto; margin: 10px 0 8px; }
.btn-light { background: var(--rp-cream); color: var(--rp-charcoal); }
.rp-k { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .18em; }
.rp-d { display: block; margin-top: 4px; font-weight: 500; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.kpi { background: #fff; border-radius: 12px; padding: 16px 18px; border: 1px solid var(--line); }
.kpi b { display: block; font: 900 1.8rem/1 var(--font-display); color: var(--blue); }
.kpi span { font-size: .85rem; color: var(--muted); }

.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 20px; }
.admin-tab { background: none; border: 0; font: 700 .92rem var(--font-display); padding: 12px 14px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.admin-tab.active { color: var(--blue); border-bottom-color: var(--gold); }
.badge-count { background: #d92d20; color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }

.rows { display: grid; gap: 12px; }
.row { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.row.done { opacity: .62; }
.row-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.row-head h4 { margin: 0; font: 700 1.02rem var(--font-display); }
.row-meta { font-size: .84rem; color: var(--muted); }
.row-text { white-space: pre-wrap; margin: 10px 0 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status { font-size: .74rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; letter-spacing: .05em; }
.status-new { background: var(--gold-50); color: #8a6400; }
.status-ok { background: #e7f6ef; color: #13795b; }
.sub-replies { margin-top: 10px; display: grid; gap: 8px; }
.sub-reply { display: flex; justify-content: space-between; gap: 12px; align-items: start; border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; }
.sub-reply p { margin: 2px 0 0; white-space: pre-wrap; }

.upload { margin-bottom: 24px; }
.upload h3, .narrow h3 { margin: 0; }
.narrow { max-width: 460px; }
.photo-group h3 { margin: 24px 0 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--blue-50); }
.photo-body { padding: 10px; display: grid; gap: 8px; }
.photo-body input { width: 100%; font: inherit; font-size: .88rem; padding: 7px 9px; border: 1.5px solid var(--line); border-radius: 8px; }
.photo-body .row-actions .btn { flex: 1; }
.muted-empty { color: var(--muted); padding: 24px; text-align: center; background: #fff; border: 2px dashed var(--line); border-radius: 12px; }

@media (max-width: 720px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .who { display: none; }
}

/* blitz ratings */
.rating-row { grid-template-columns: 2fr 2fr 1.4fr; }
.rating-edit { display: grid; grid-template-columns: 2fr 2fr 1fr auto auto; gap: 10px; align-items: center; padding: 12px 14px; }
.rating-edit input { width: 100%; font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; }
.rating-val { font: 900 1.3rem var(--font-display); color: var(--blue); min-width: 56px; text-align: right; }
@media (max-width: 720px) { .rating-row, .rating-edit { grid-template-columns: 1fr; } }
