/* =========================================================
   FilipinoToDate — admin
   Layout: puti nga top bar, navigation sa wala (sidebar), abuhon
   nga background. Usa ra ka accent nga kolor (asul).
   ========================================================= */
:root {
  --ink: #1F1F1F;
  --ink-soft: #444746;
  --muted: #5F6368;
  --line: #E3E3E3;
  --bg: #F8F9FA;
  --brand: #1A73E8;
  --brand-soft: #E8F0FE;
  --ok: #188038;
  --ok-soft: #E6F4EA;
  --bad: #D93025;
  --bad-soft: #FCE8E6;
  --r: 8px;
  --top-h: 64px;
  --side-w: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
body.adm {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); }
h1, h2, h3 { margin: 0; font-weight: 600; }
img { display: block; max-width: 100%; }

/* ---------- Top bar ---------- */
.adm-top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px 0 16px;
  background: #17121F; color: #fff;
}
.adm-menu {
  display: none; width: 40px; height: 40px; padding: 8px;
  border: 0; border-radius: 50%; background: none; color: rgba(255,255,255,.85); cursor: pointer;
}
.adm-menu:hover { background: rgba(255,255,255,.1); }
.adm-menu svg { width: 24px; height: 24px; fill: currentColor; }
.adm-brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none; font-size: 18px; font-weight: 500;
}
.adm-brand b { font-weight: 500; color: rgba(255,255,255,.6); }
.adm-me { margin-left: auto; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.85); font-weight: 500; }
.adm-me-av {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600;
}

/* ---------- Sidebar ---------- */
.adm-side {
  position: fixed; top: var(--top-h); bottom: 0; left: 0; z-index: 20;
  width: var(--side-w);
  display: flex; flex-direction: column;
  padding: 12px 12px 12px 0;
  background: #fff; border-right: 1px solid var(--line);
  overflow-y: auto;
}
.adm-nav { display: grid; gap: 2px; }
.adm-nav-group {
  margin: 16px 0 4px; padding: 12px 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.adm-nav a, .adm-side-foot a, .adm-side-foot button {
  display: flex; align-items: center; gap: 14px; width: 100%;
  height: 40px; padding: 0 16px 0 24px;
  border: 0; border-radius: 0 20px 20px 0; background: none;
  color: var(--ink); font: inherit; font-weight: 500; text-decoration: none; text-align: left;
  cursor: pointer;
}
.adm-nav a svg, .adm-side-foot svg { flex: none; width: 20px; height: 20px; fill: var(--muted); }
.adm-nav a:hover, .adm-side-foot a:hover, .adm-side-foot button:hover { background: #F1F3F4; }
.adm-nav a.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.adm-nav a.is-active svg { fill: var(--brand); }
.adm-nav a > span:first-of-type { flex: 1; }
.adm-badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 600;
}
.adm-side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.adm-side-foot form { margin: 0; }
.adm-scrim { display: none; }

/* ---------- Main ---------- */
.adm-main { margin-left: var(--side-w); padding: calc(var(--top-h) + 28px) 32px 40px; max-width: calc(1200px + var(--side-w)); }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.adm-head h1 { font-size: 26px; font-weight: 500; }
.adm-count { color: var(--muted); font-weight: 600; font-size: 16px; }
.adm-empty { padding: 40px; text-align: center; color: var(--muted); background: #fff; border-radius: var(--r); }
.adm-flash { margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.adm-flash.is-ok { background: var(--ok-soft); color: var(--ok); }
.adm-flash.is-error { background: var(--bad-soft); color: var(--bad); }
.adm-section { margin-top: 28px; }
.adm-section > h2 { font-size: 18px; font-weight: 500; margin-bottom: 12px; }

/* ---------- Buttons ---------- */
.adm-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-decoration: none;
}
.adm-btn:hover { border-color: var(--ink-soft); }
.adm-btn.is-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.adm-btn.is-bad { background: #fff; border-color: var(--bad); color: var(--bad); }
.adm-btn.is-bad:hover { background: var(--bad); color: #fff; }
.adm-btn.is-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.adm-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; }
.adm-link.is-bad { color: var(--bad); }
.adm-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adm-acts form { margin: 0; }
.adm-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 600;
  vertical-align: middle;
}
.adm-tag.is-pending { background: #FEF3C7; color: #92400E; }
.adm-tag.is-bad { background: var(--bad-soft); color: var(--bad); }
.adm-tag.is-ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Avatar ---------- */
.adm-av {
  flex: none; display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: #BDC1C6; color: #fff; font-weight: 600;
}
.adm-av img { width: 100%; height: 100%; object-fit: cover; }
.adm-av.is-sm { width: 36px; height: 36px; font-size: 15px; }
.adm-av.is-md { width: 56px; height: 56px; font-size: 22px; }
.adm-av.is-lg { width: 96px; height: 96px; font-size: 36px; }
.ph-1 { background: linear-gradient(135deg,#F472B6,#A855F7); }
.ph-2 { background: linear-gradient(135deg,#FB923C,#F43F5E); }
.ph-3 { background: linear-gradient(135deg,#38BDF8,#6366F1); }
.ph-4 { background: linear-gradient(135deg,#34D399,#0EA5E9); }
.ph-5 { background: linear-gradient(135deg,#FBBF24,#F97316); }
.ph-6 { background: linear-gradient(135deg,#A78BFA,#EC4899); }

/* ---------- Overview ---------- */
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.adm-stat {
  display: block; padding: 18px 20px; border-radius: var(--r);
  background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.adm-stat:hover { border-color: var(--brand); }
.adm-stat strong { display: block; font-size: 32px; font-weight: 500; margin-bottom: 4px; }
.adm-stat span { color: var(--muted); font-weight: 500; }

/* ---------- Table ---------- */
.adm-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.adm-table th, .adm-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-table th { font-size: 12px; font-weight: 600; color: var(--muted); background: #F8F9FA; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-who { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.adm-who small { display: block; color: var(--muted); }

/* ---------- Photo queue ---------- */
.adm-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.adm-photo { position: relative; margin: 0; background: #fff; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.adm-photo > a img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #EEE; }
.adm-photo .adm-tag { position: absolute; top: 10px; left: 10px; }
.adm-photo figcaption { padding: 12px; display: grid; gap: 10px; }
.adm-photo figcaption small { display: block; color: var(--muted); }
.adm-photo .adm-acts form { flex: 1; }
.adm-photo .adm-acts .adm-btn { width: 100%; }

/* ---------- Cards (profiles, report detail) ---------- */
.adm-card { background: #fff; border-radius: var(--r); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 14px; }
.adm-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.adm-card-head h2, .adm-card-head h3 { font-size: 17px; }
.adm-meta { color: var(--muted); font-size: 13px; }
.adm-field { padding: 10px 0; border-top: 1px solid var(--line); }
.adm-field-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.adm-field-head form { margin: 0; }
.adm-field p { margin: 0; color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; }
.adm-field em { color: var(--muted); }
.adm-card > .adm-acts { margin-top: 14px; }

/* ---------- Reports ---------- */
.adm-report { padding: 12px 0; border-top: 1px solid var(--line); }
.adm-report:first-of-type { border-top: 0; padding-top: 0; }
.adm-report p { margin: 6px 0; white-space: pre-wrap; }
.adm-report form { display: flex; gap: 8px; margin-top: 8px; }
.adm-report input[type="text"] { flex: 1; }
.adm-chat { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.adm-msg { max-width: 75%; justify-self: start; padding: 8px 12px; border-radius: 12px; background: #F1F3F4; }
.adm-msg.is-reporter { justify-self: end; background: var(--brand-soft); }
.adm-msg small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.adm-msg div { white-space: pre-wrap; word-break: break-word; }
.adm-mini-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.adm-mini-photos figure { position: relative; margin: 0; width: 140px; }
.adm-mini-photos img { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; }
.adm-mini-photos .adm-tag { position: absolute; top: 6px; left: 6px; }
.adm-mini-photos form { margin-top: 6px; }
.adm-mini-photos .adm-btn { width: 100%; }

/* ---------- Forms ---------- */
.adm-search { display: flex; gap: 8px; flex-wrap: wrap; }
input[type="text"], input[type="password"], input[type="search"], select {
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- Pager ---------- */
.adm-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; color: var(--muted); }
.adm-pager a { font-weight: 700; text-decoration: none; }

/* ---------- Log ---------- */
.adm-log { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--r); border: 1px solid var(--line); }
.adm-log li { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.adm-log li:last-child { border-bottom: 0; }
.adm-log time { color: var(--muted); min-width: 140px; }

/* ---------- Login ---------- */
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.adm-login form {
  width: 100%; max-width: 380px; display: grid; gap: 14px;
  padding: 28px; background: #fff; border-radius: 16px; border: 1px solid var(--line);
}
.adm-login h1 { font-size: 22px; }
.adm-login h1 span { color: var(--brand); }
.adm-login label { display: grid; gap: 6px; font-weight: 700; font-size: 13px; }
.adm-login .adm-btn { padding: 12px; }

/* Gamay nga screen: ang sidebar motago, mogawas pinaagi sa menu nga buton. */
@media (max-width: 900px) {
  .adm-menu { display: block; }
  .adm-side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.is-nav-open .adm-side { transform: none; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
  body.is-nav-open .adm-scrim {
    display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 15; background: rgba(0,0,0,.32);
  }
  .adm-main { margin-left: 0; padding: calc(var(--top-h) + 20px) 16px 32px; }
}
@media (max-width: 700px) {
  .adm-me-name { display: none; }
  .adm-brand { font-size: 16px; }
  .adm-table th:nth-child(n+4), .adm-table td:nth-child(n+4) { display: none; }
}

/* ---------- Payments ---------- */
.adm-kv { border: 1px solid var(--line); }
.adm-kv th { width: 160px; text-transform: none; letter-spacing: 0; font-size: 13px; }

/* ---- Manual upgrade (admin/members.php) ---- */
.adm-upgrade h3 { margin: 0 0 12px; font-size: 15px; }
.adm-upgrade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.adm-upgrade-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink); }
.adm-upgrade-grid label small { font-weight: 400; color: var(--muted); }
.adm-upgrade-grid input,
.adm-upgrade-grid select {
  width: 100%; padding: 8px 10px;
  font: inherit; font-size: 14px; font-weight: 400;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.adm-upgrade-money { display: flex; gap: 6px; }
.adm-upgrade-money select { width: 84px; flex: none; }
.adm-upgrade-wide { grid-column: 1 / -1; }
.adm-upgrade-grid textarea {
  width: 100%; padding: 8px 10px; resize: vertical;
  font: inherit; font-size: 14px; font-weight: 400; line-height: 1.5;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}

/* ---- Mass mailer progress (admin/mailer.php) ---- */
.ml-bar { height: 10px; margin-top: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ml-bar span { display: block; height: 100%; background: #1E8E3E; transition: width .4s ease; }
