/* Diocese of Kumba — admin panel shell. Loaded alongside styles.css. */
* { box-sizing: border-box; }
body.admin { margin: 0; background: #f4f1ea; font-family: var(--sans); color: var(--ink); }

.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #2a1015; color: #d9c9b6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar__brand { display: flex; align-items: center; gap: .6rem; padding: 1.2rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar__brand img { width: 38px; height: 38px; }
.sidebar__brand b { font-family: var(--serif); color: #fff; font-size: 1.05rem; line-height: 1.1; }
.sidebar__brand span { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); }
.sidebar nav { padding: .8rem; display: flex; flex-direction: column; gap: .15rem; overflow-y: auto; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 8px; color: #d9c9b6; text-decoration: none; font-weight: 600; font-size: .95rem; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--wine); color: #fff; }
.sidebar nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.sidebar__foot { padding: .8rem; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: .3rem; }
.sidebar__foot a { color: var(--gold-soft); font-size: .88rem; text-decoration: none; padding: .5rem .8rem; border-radius: 8px; }
.sidebar__foot a:hover { background: rgba(255,255,255,.08); color: #fff; }

.admin-main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem); }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.7rem; margin: 0; color: var(--wine-dark); }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 1.4rem; margin-bottom: 1.4rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm); }
.stat-card .n { font-family: var(--serif); font-size: 2rem; font-weight: 800; color: var(--wine); line-height: 1; }
.stat-card .l { color: var(--muted); font-size: .88rem; margin-top: .3rem; }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
table.admin-table th, table.admin-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .94rem; }
table.admin-table thead th { background: var(--cream); color: var(--wine-dark); font-weight: 700; position: sticky; top: 0; }
table.admin-table tbody tr:hover { background: var(--ivory); }
.row-actions { display: flex; gap: .4rem; white-space: nowrap; }

.btn-sm { padding: .4rem .8rem; font-size: .85rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--wine); font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.btn-sm:hover { background: var(--cream); }
.btn-sm.danger { color: #a12b2b; border-color: #e6b3b3; }
.btn-sm.danger:hover { background: #fdeeee; }

.admin .field { margin-bottom: 1rem; }
.admin label { font-weight: 600; font-size: .9rem; display:block; margin-bottom: .3rem; }
.admin input, .admin textarea, .admin select { width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 8px; font-family: var(--sans); font-size: .98rem; background: #fff; }
.admin input:focus, .admin textarea:focus, .admin select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .admin-layout { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; font-size: .92rem; }
.alert--ok { background: #eef8f0; color: #1f5c3d; border: 1px solid #bcdcc4; }
.alert--err { background: #fdeeee; color: #8a2b2b; border: 1px solid #e6b3b3; }
.pill { display:inline-block; padding:.15rem .55rem; border-radius:50px; font-size:.72rem; font-weight:700; background:var(--cream); color:var(--wine); }
.pill--off { background:#eee; color:#888; }
.muted { color: var(--muted); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #6e1423, #360912); padding: 1rem; }
.login-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 2.2rem; width: min(100%, 400px); }
.login-card .brand-row { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.2rem; }
.login-card .brand-row img { width: 46px; height: 46px; }
