/* =========================================================
   Akshai Kumar Pammi — Ministries · Admin dashboard
   (reuses design tokens from style.css)
   ========================================================= */
.admin-body { min-height: 100vh; }
[hidden] { display: none !important; }

/* ---- Login ---- */
.admin-login {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}
.login-card {
  position: relative;
  z-index: 2;
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(28px, 5vw, 44px);
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card .brand__mark { margin: 0 auto 4px; }
.login-card h1 { font-family: var(--ff-display); font-weight: 600; font-size: 1.6rem; margin-top: 12px; }
.login-sub { color: var(--muted); margin-bottom: 24px; }
.login-card .a-field { text-align: left; }
.login-error { color: var(--wine-2); min-height: 1.2em; font-size: 0.9rem; margin-top: 10px; font-weight: 500; }
.login-note { font-size: 0.78rem; color: var(--muted-2); margin-top: 18px; line-height: 1.6; }

/* ---- Dashboard frame ---- */
.admin__bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 13px clamp(16px, 3vw, 26px);
  background: rgba(14, 11, 18, 0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.admin__brand { display: flex; align-items: center; gap: 11px; font-family: var(--ff-display); font-weight: 600; font-size: 1.1rem; }
.admin__brand .brand__mark { width: 38px; height: 38px; font-size: 1.25rem; border-radius: 10px; }
.admin__bar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { font-size: 0.78rem; color: var(--muted); padding: 7px 14px; border: 1px solid var(--line); border-radius: 100px; transition: color 0.3s, border-color 0.3s; white-space: nowrap; }
.status.ok { color: var(--gold); border-color: rgba(227, 184, 115, 0.4); }

.admin__layout { display: grid; grid-template-columns: 244px 1fr; }
.admin__nav {
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 61px; align-self: start;
  height: calc(100vh - 61px); overflow: auto;
}
.admin__nav button {
  text-align: left; padding: 11px 16px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 0.95rem;
  transition: background 0.25s, color 0.25s;
}
.admin__nav button:hover { background: rgba(255, 255, 255, 0.04); color: var(--cream); }
.admin__nav button.active { background: rgba(227, 184, 115, 0.12); color: var(--gold); }
.admin__main { padding: clamp(24px, 4vw, 42px); max-width: 860px; }

/* ---- Panel ---- */
.panel-head h2 { font-family: var(--ff-display); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.panel-head p { color: var(--muted); margin: 6px 0 26px; }
.a-sub { font-size: 0.76rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin: 28px 0 14px; }

/* ---- Fields ---- */
.a-field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.a-field > label { font-size: 0.85rem; font-weight: 600; color: var(--cream); }
.a-field input, .a-field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.98rem;
  resize: vertical;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.a-field input:focus, .a-field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(227, 184, 115, 0.14);
}
.a-hint { font-size: 0.8rem; color: var(--muted-2); line-height: 1.5; }
.a-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.a-row2 .a-field { margin-bottom: 0; }

/* ---- Image field ---- */
.a-imgrow { display: flex; gap: 14px; align-items: flex-start; }
.a-thumb { width: 92px; height: 92px; flex: none; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; }
.a-thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-thumb img:not([src]), .a-thumb img[src=""] { opacity: 0; }
.a-imgcol { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.a-file { display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 0.86rem; text-align: center; transition: border-color 0.25s, color 0.25s; align-self: flex-start; }
.a-file:hover { border-color: var(--gold); color: var(--gold); }

/* ---- List items ---- */
.a-list { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.a-item { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 18px 18px 4px; }
.a-item__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.a-item__num { font-family: var(--ff-display); color: var(--muted-2); font-size: 0.95rem; }
.a-item__actions { display: flex; gap: 6px; }
.a-iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; font-size: 0.95rem; transition: border-color 0.25s, color 0.25s, background 0.25s; }
.a-iconbtn:hover { border-color: var(--gold); color: var(--gold); }
.a-iconbtn--danger:hover { border-color: var(--wine-2); color: var(--wine-2); background: rgba(165, 42, 71, 0.08); }
.a-add { margin-top: 16px; width: 100%; padding: 13px 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--gold); font-weight: 600; transition: border-color 0.25s, background 0.25s; }
.a-add:hover { border-color: var(--gold); background: rgba(227, 184, 115, 0.06); }

/* ---- Buttons ---- */
.a-btn { padding: 11px 18px; border-radius: 100px; font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s; }
.a-btn--gold { background: var(--grad-gold); color: #2a1d08; }
.a-btn--gold:hover { transform: translateY(-2px); }
.a-btn--ghost { border-color: var(--line); color: var(--cream); }
.a-btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.a-btn--danger { border-color: rgba(165, 42, 71, 0.5); color: var(--wine-2); }
.a-btn--danger:hover { background: rgba(165, 42, 71, 0.12); }
.a-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ---- Security note ---- */
.a-security {
  margin-top: 30px; padding: 16px 18px;
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 10px; background: var(--surface);
  font-size: 0.86rem; color: var(--muted); line-height: 1.6;
}
.a-security code { background: var(--bg); padding: 1px 6px; border-radius: 5px; font-size: 0.85em; color: var(--gold-soft); }
.a-security strong { color: var(--cream); }

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .admin__layout { grid-template-columns: 1fr; }
  .admin__nav {
    position: static; height: auto; flex-direction: row; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--line); padding: 12px;
  }
  .admin__nav button { white-space: nowrap; }
}
@media (max-width: 540px) {
  .a-row2 { grid-template-columns: 1fr; gap: 0; }
  .a-row2 .a-field { margin-bottom: 18px; }
  .admin__bar-actions .a-btn { flex: 1; }
}
