body.admin { background: #fbf4f2; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side { background: var(--card); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.admin-side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-side nav a { padding: 10px 14px; border-radius: 12px; color: var(--ink); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.admin-side nav a:hover { background: var(--bg-soft); text-decoration: none; }
.admin-side nav a.active { background: var(--burgundy); color: #fff; }
.badge { background: var(--gold); color: #3a1722; border-radius: 999px; padding: 0 9px; font-size: 13px; font-weight: 700; }
.admin-user { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.admin-main { padding: 28px clamp(16px, 4vw, 48px) 60px; max-width: 1100px; width: 100%; }
.admin-main h1 { font-size: 34px; }
.admin-guest { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, var(--pink), var(--bg)); }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; }
.stat:hover { text-decoration: none; transform: translateY(-2px); }
.stat b { font: 700 40px/1.1 'Playfair Display', Georgia, serif; color: var(--burgundy); }
.stat span { color: var(--muted); }
.stat-alert { border-color: var(--gold); background: #fff9e8; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin: 0; font-size: 22px; }
.mini-row { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.row-actions form { margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.filters input, .filters select { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.filters input { flex: 1; min-width: 180px; }
.table-panel { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.table .actions { white-space: nowrap; display: flex; gap: 12px; align-items: center; }
.table .actions form { margin: 0; }
.status { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.status-published { background: #e6f4ea; color: #1b5e20; }
.status-pending { background: #fff3cd; color: #7a5b00; }
.status-rejected { background: #fde7ea; color: #8a1c2f; }
.link-danger { background: none; border: 0; color: #b3261e; cursor: pointer; font: inherit; padding: 0; }
.link-danger:hover { text-decoration: underline; }

.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.form-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.form-card input, .form-card select, .form-card textarea { font: inherit; font-weight: 400; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); width: 100%; }
.form-card textarea { resize: vertical; line-height: 1.6; font-size: 16px; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.form-card .check { flex-direction: row; align-items: center; font-weight: 400; }
.form-card .check input { width: auto; }
.form-wide { max-width: 860px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.error { color: #b3261e; margin: -8px 0 0; font-size: 14px; }
.flash-error { background: #fde7ea; color: #8a1c2f; }
.admin-main .flash { margin: 0 0 18px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.page-narrow { max-width: 760px; }

.login-card { width: min(400px, 100%); }
.login-logo { display: flex; align-items: center; gap: 14px; }
.login-logo h1 { margin: 0; font-size: 32px; }

.cat-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; border-top: 1px solid var(--line); }
.cat-row form { margin: 0; }
.cat-edit { display: flex; gap: 8px; flex: 1; }
.cat-edit input { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); flex: 1; min-width: 0; }
.cat-edit .slug { flex: .6; color: var(--muted); }
.cat-new { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--pink-strong); }

@media (max-width: 800px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .admin-side nav { flex-direction: row; flex-wrap: wrap; }
    .stats, .form-row { grid-template-columns: 1fr; }
    .cat-row { flex-wrap: wrap; }
}
