/* ==========================================================================
   WBPWA — Master Admin Panel styles (admin.html)
   ========================================================================== */

:root {
  --navy: #142850;
  --navy-dark: #0d1c3a;
  --navy-soft: #24406f;
  --gold: #ffc72c;
  --gold-dark: #e8b31d;
  --bg: #f2f5fa;
  --card: #ffffff;
  --ink: #1c2536;
  --muted: #68738a;
  --line: #e3e9f2;
  --ok: #18a558;
  --bad: #d9433f;
  --radius: 12px;
  --shadow: 0 12px 30px rgba(20, 40, 80, 0.10);
  --font: "Poppins", "Noto Sans Bengali", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--navy-soft); }
h1, h2, h3, h4 { font-family: var(--font); margin: 0 0 8px; line-height: 1.3; }

[hidden] { display: none !important; }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 20% -10%, rgba(255, 199, 44, .16), transparent 60%),
    linear-gradient(150deg, var(--navy-dark), var(--navy) 55%, var(--navy-soft));
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
  padding: 34px 30px 26px;
  text-align: center;
}

.login-card img { width: 74px; height: 74px; object-fit: contain; }
.login-card h1 { font-size: 21px; margin-top: 12px; color: var(--navy); }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }

.login-card form { text-align: left; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }

.login-card input[type="password"],
.login-card input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.login-card input:focus { border-color: var(--navy-soft); }

.remember { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; color: var(--muted); }
.remember input { width: auto !important; }

.login-err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }

.back-link { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--navy); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-gold { background: var(--gold); color: #17233f; box-shadow: 0 8px 18px rgba(255, 199, 44, .35); }
.btn-navy { background: var(--navy); color: #fff; box-shadow: 0 8px 18px rgba(20, 40, 80, .25); }
.btn-ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; }
.btn-danger { background: #fff1f0; color: var(--bad); border: 1.5px solid #ffd3d1; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- Shell ---------------- */
.admin-shell { display: flex; min-height: 100vh; }

.admin-side {
  width: 250px;
  flex: 0 0 250px;
  background: linear-gradient(180deg, var(--navy-dark), var(--navy));
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
}

.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.side-brand img { width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 4px; }
.side-brand b { font-size: 15px; display: block; }
.side-brand span { font-size: 11.5px; color: rgba(255,255,255,.6); }

.side-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,.06);
  border: 1px solid transparent;
  color: rgba(255,255,255,.85);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.side-nav button:hover { background: rgba(255,255,255,.13); }
.side-nav button.active { background: var(--gold); color: #17233f; font-weight: 600; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.side-foot a, .side-foot button {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-family: var(--font);
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.side-foot a:hover, .side-foot button:hover { background: rgba(255,255,255,.16); }

/* ---------------- Beta marketplace launcher ---------------- */
.side-beta { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.beta-launch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, rgba(224,175,39,.22), rgba(224,175,39,.08));
  border: 1px solid rgba(224,175,39,.45);
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.beta-launch:hover {
  background: linear-gradient(135deg, rgba(224,175,39,.36), rgba(224,175,39,.16));
  border-color: var(--gold);
  transform: translateY(-1px);
}
.beta-icon {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  background: var(--gold); color: #17233f;
  border-radius: 9px; font-size: 17px;
}
.beta-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.beta-text strong { font-size: 13px; font-family: var(--font); color: #fff; }
.beta-text small { font-size: 11px; color: rgba(255,255,255,.62); }
.beta-tag {
  margin-left: auto; flex: 0 0 auto;
  background: var(--gold); color: #17233f;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 999px; font-family: var(--font);
}
.beta-note {
  margin: 9px 2px 0;
  font-size: 10.8px; line-height: 1.45;
  color: rgba(255,255,255,.45);
  font-family: var(--font);
}

/* ---------------- Main ---------------- */
.admin-main { flex: 1; padding: 22px 26px 60px; min-width: 0; }

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.admin-top h2 { font-size: 22px; color: var(--navy); margin: 0; }
.top-right { display: flex; align-items: center; gap: 10px; }

.pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  background: #e7f7ee;
  color: var(--ok);
}
.pill.dirty { background: #fff4e0; color: #c77b00; }

/* cards / views */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card h3 { font-size: 16.5px; color: var(--navy); }
.card .hint { font-size: 13px; color: var(--muted); margin: -2px 0 14px; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 900px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; flex: none; height: auto; position: static; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy-soft);
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--navy-soft);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 74px; }
.field .mini { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] {
  width: 54px;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 3px;
  cursor: pointer;
}
.color-field span { font-size: 13px; font-weight: 600; color: var(--muted); }

/* dashboard cards */
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
.dash-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.dash-card .ico { font-size: 22px; }
.dash-card b { display: block; font-size: 15px; color: var(--navy); margin-top: 6px; }
.dash-card span { font-size: 12.5px; color: var(--muted); }

.steps { counter-reset: step; padding-left: 0; list-style: none; margin: 0; }
.steps li {
  position: relative;
  padding: 0 0 14px 42px;
  font-size: 14px;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps li::after {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.steps li:last-child::after { display: none; }
.steps li b { color: var(--navy); }

/* content editor */
.ce-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.ce-toolbar select, .ce-toolbar input[type="search"] {
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-family: var(--font);
  font-size: 14px;
  background: #fff;
  outline: none;
}
.ce-toolbar input[type="search"] { flex: 1; min-width: 180px; }

.ce-count { font-size: 13px; color: var(--muted); }

.ce-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ce-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  padding: 2px 7px;
}
.idx { font-size: 11px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 2px 7px; font-weight: 600; }
.warn-badge { font-size: 11px; background: #fff4e0; color: #c77b00; border-radius: 6px; padding: 2px 7px; font-weight: 600; }
.edited-badge { font-size: 11px; background: #e7f7ee; color: var(--ok); border-radius: 6px; padding: 2px 7px; font-weight: 600; }
.ce-item-head .spacer { flex: 1; }

.ce-item textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-family: var(--font);
  font-size: 14px;
  resize: vertical;
  min-height: 54px;
  outline: none;
  background: #fbfcfe;
}
.ce-item textarea:focus { border-color: var(--navy-soft); background: #fff; }
.ce-item textarea.edited { border-color: var(--gold-dark); background: #fffdf5; }

.ce-empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 14px; }

/* publish action rows */
.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.action-row .txt { flex: 1; }
.action-row .txt b { display: block; font-size: 14.5px; color: var(--navy); }
.action-row .txt span { font-size: 12.5px; color: var(--muted); }

.note {
  background: #fff9e8;
  border: 1px solid #ffe7a8;
  color: #7a5b00;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
}
.note code { background: #fff2c9; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(30px);
  background: var(--navy-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0,0,0,.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 99;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--bad); }

/* details (hero slides) */
details.slide-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 16px;
  margin-bottom: 10px;
}
details.slide-box summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--navy);
  padding: 14px 0;
  list-style: none;
}
details.slide-box summary::-webkit-details-marker { display: none; }
details.slide-box summary::before { content: "▸ "; color: var(--gold-dark); }
details.slide-box[open] summary::before { content: "▾ "; }
details.slide-box .inner { padding-bottom: 16px; }

.sep { height: 1px; background: var(--line); margin: 18px 0; }

/* =====================================================================
   MEMBER DIRECTORY (view "members")
   ===================================================================== */
.dm-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.dm-head h3 { margin: 0 0 6px; }
.dm-headbtns { display: flex; gap: 10px; flex-wrap: wrap; }

.dm-auth { border: 1px dashed var(--gold-dark); background: #fffdf4; }
.dm-auth h3 { margin: 0 0 6px; }
.dm-auth .field { margin-top: 12px; max-width: 340px; }
.dm-err { color: var(--bad); margin-top: 8px; min-height: 1em; }

.dm-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.dm-toolbar input[type="search"] {
  flex: 1 1 260px; min-width: 0; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; font-family: inherit;
}
.dm-toolbar input[type="search"]:focus { outline: none; border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(255,199,44,.25); }
.dm-stat { font-size: 13.5px; color: var(--muted); white-space: nowrap; }

.dm-phonebar {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; padding: 13px 16px; margin-bottom: 16px;
  background: var(--navy); color: #fff; border-radius: var(--radius);
}
.dm-phonebar b { display: block; font-size: 14.5px; }
.dm-phonebar span { font-size: 13px; color: #ffd97a; }
.dm-phonebtns { display: flex; gap: 9px; flex-wrap: wrap; }
.dm-phonebtns button {
  padding: 9px 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.10); color: #fff; font-size: 13.5px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: .18s;
}
.dm-phonebtns button:hover { background: var(--gold); color: var(--navy-dark); border-color: var(--gold); }

.dm-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.dm-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
.dm-table thead th {
  position: sticky; top: 0; background: var(--bg); text-align: left;
  padding: 11px 12px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.dm-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dm-table tbody tr:last-child td { border-bottom: none; }
.dm-table tbody tr:hover { background: #fafcff; }
.dm-mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; color: var(--navy-soft); white-space: nowrap; }
.dm-quiet { color: var(--muted); max-width: 230px; }
.dm-tdphoto { width: 54px; }
.dm-tdphoto img { width: 40px; height: 48px; object-fit: cover; border-radius: 6px; display: block; background: var(--bg); }
.dm-noimg { color: var(--muted); }
.dm-numcell { white-space: nowrap; }
.dm-num { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }
.dm-hidetag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: #fdecec; color: var(--bad); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.dm-act { text-align: right; white-space: nowrap; }
.dm-act button {
  width: 31px; height: 31px; margin-left: 4px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px;
  transition: .16s;
}
.dm-act button:hover { background: var(--gold); border-color: var(--gold); }
.dm-act button[data-act="del"]:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.dm-empty { padding: 34px 16px; text-align: center; color: var(--muted); }

/* ---------------- add / edit ---------------- */
.dm-modal {
  position: fixed; inset: 0; z-index: 90; background: rgba(13, 28, 58, .62);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.dm-modal[hidden] { display: none; }
.dm-modal-box {
  width: 100%; max-width: 720px; background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
/* The head had padding and the body had none, so every panel body sat
   flush against the box edge — under the rounded corner, where the first
   glyph of a Bengali label loses itself.  Match the head. */
.dm-modal-body { padding: 18px 22px 22px; }
.dm-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--navy); color: #fff;
}
.dm-modal-head h3 { margin: 0; font-size: 17px; }
.dm-x {
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: #fff; font-size: 15px;
}
.dm-x:hover { background: var(--bad); }

.dm-photo-row { display: flex; gap: 16px; align-items: center; padding: 18px 22px 0; }
.dm-photo {
  width: 84px; height: 100px; border-radius: 10px; background: var(--bg);
  display: grid; place-items: center; overflow: hidden; flex: none;
  border: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; text-align: center;
}
.dm-photo img { width: 100%; height: 100%; object-fit: cover; }
.dm-filebtn {
  display: inline-block; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--navy);
}
.dm-filebtn:hover { background: var(--gold); border-color: var(--gold); }
.dm-photo-row .hint { margin: 7px 0 4px; }
.dm-linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--bad); font-size: 13px; text-decoration: underline; font-family: inherit;
}

#dmForm { padding: 18px 22px 22px; }
.dm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dm-span2 { grid-column: 1 / -1; }

.dm-checks { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.dm-check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.dm-check input { margin-top: 3px; accent-color: var(--gold-dark); width: 16px; height: 16px; }
.dm-hidecheck {
  padding: 11px 14px; border-radius: 10px; background: #fff8e6;
  border: 1px solid #ffe6a6;
}

.dm-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 640px) {
  .dm-grid { grid-template-columns: 1fr; }
  .dm-headbtns { width: 100%; }
  .dm-headbtns .btn { flex: 1; }
}

/* ---------- founder members ---------- */
.fm-hidetag, .fm-visibletag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.fm-hidetag    { background: #ffeccc; color: #a15c00; border: 1px solid #ffd79a; }
.fm-visibletag { background: #e6f6ec; color: #16794a; border: 1px solid #b9e7cb; }

/* A card that is off the public page still has to be findable in the list —
   greying it out says "present, not showing" where a missing row would read
   as "deleted". */
.fm-rowhidden td { opacity: 0.6; }
.fm-rowhidden .dm-tdphoto img { filter: grayscale(1); }

.dm-photostat { font-weight: 500; }

/* =====================================================================
 *  MEMBERSHIP MODULE
 *
 *  The membership tab is the busiest screen in the panel: a status rail, a
 *  filter row, four tables and two modals.  It gets its own block rather
 *  than borrowing from the founders styles, because the differences are
 *  the point — statuses have colours, rows carry a decision, and the
 *  filter bar has more than one control in it.
 * ===================================================================== */

/* ---------------- tabs ---------------- */

.dm-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: 0 0 16px;
}

.dm-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.dm-tab:hover { color: var(--navy); }

.dm-tab.active {
  color: var(--navy);
  border-bottom-color: var(--gold-dark);
}

/* ---------------- filter bar ---------------- */

.dm-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.dm-filters input[type="search"] {
  flex: 1 1 260px;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}

.dm-filters select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}

.dm-filters input:focus,
.dm-filters select:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(255, 199, 44, .22);
}

/* ---------------- pagination ---------------- */

.dm-pager {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 13.5px;
  color: #64748b;
}

.dm-pager button {
  appearance: none;
  min-width: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.dm-pager button:hover:not(:disabled) { border-color: var(--gold-dark); color: var(--navy); }

.dm-pager button:disabled { opacity: .4; cursor: default; }

.dm-pager button.current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 700;
}

/* ---------------- settings grid ---------------- */

.dm-formgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px 16px;
  margin-top: 6px;
}

.dm-formgrid .field { margin: 0; }

/* ---------------- status pills ---------------- */

.dm-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.dm-badge.ok      { background: #e8f7ee; color: #14663a; }
.dm-badge.warn    { background: #fff4e5; color: #8a4b08; }
.dm-badge.bad     { background: #fdeaea; color: #8f1d1d; }
.dm-badge.quiet   { background: #eef1f6; color: #475569; }

/* ---------------- detail modal body ---------------- */

.mx-grid {
  display: grid;
  /* min(200px, 100%): a 200px floor larger than the container would push the
     whole grid out of the clipped box, cutting the first column off. */
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 10px 18px;
  margin: 0 0 16px;
}

/* Grid items default to min-width:auto, so one long value widens its track
   past the container.  min-width:0 lets the track shrink and the text wrap. */
.mx-grid > div { min-width: 0; }

.mx-grid dt { font-size: 12.5px; color: #64748b; }

/* In edit mode the dt/dd pair is replaced by a label and a control. */
.mx-grid .mx-input {
  width: 100%; box-sizing: border-box; margin-top: 3px;
  padding: 7px 10px; font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.mx-grid .mx-input:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(13, 28, 58, .09);
}
.mx-grid .mx-input:invalid { box-shadow: none; }
#mxEditForm { margin-bottom: 6px; }
#mxEditForm #mxEditBar { grid-column: 1 / -1; margin-top: 4px; }

/* ---------------- Google link card (admin settings) ---------------- */

.mx-gcard {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 17px; background: #fbfcfe;
}
.mx-grow { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 600; }
.mx-gdot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: #cbd5e1;
}
.mx-gdot.on { background: #1f9d55; box-shadow: 0 0 0 3px rgba(31, 157, 85, .18); }
.mx-gdot.off { background: #d9a441; }
.mx-gdot.err { background: #c0392b; }
.mx-gmeta { margin: 9px 0 0; font-size: 13px; color: #64748b; line-height: 1.7; }
.mx-gmeta b { color: var(--ink, #0d1c3a); word-break: break-all; }
.mx-gactions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.mx-gnote {
  margin-top: 12px; font-size: 13px; line-height: 1.6;
  padding: 10px 12px; border-radius: 8px;
  background: #eef1f6; color: #475569;
}
.mx-gnote.bad { background: #fdeaea; color: #8f1d1d; }
.mx-gnote.ok { background: #e8f7ee; color: #14663a; }

/* ---------------- membership card ---------------- */

/* Credit-card proportions (85.6 × 54 mm, ratio 1.586).  Fixed rather than
   fluid so a printed card matches the screen one. */
.mx-card {
  width: 100%; max-width: 420px; aspect-ratio: 1.586;
  box-sizing: border-box; display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden;
  background: linear-gradient(150deg, #0d1c3a 0%, #16305f 62%, #1d3f7a 100%);
  color: #fff; box-shadow: 0 10px 26px rgba(13, 28, 58, .28);
  font-family: inherit;
}

.mx-card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.mx-card-head .mx-card-mark {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: #d9a441; color: #0d1c3a;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.mx-card-head .mx-card-org { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.mx-card-head .mx-card-org span { display: block; font-size: 9.5px; font-weight: 500; opacity: .72; letter-spacing: .08em; text-transform: uppercase; }

.mx-card-body { display: flex; gap: 13px; padding: 13px 14px 0; flex: 1; min-height: 0; }
.mx-card-photo {
  width: 78px; height: 96px; flex: none; border-radius: 8px;
  object-fit: cover; border: 2px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .12);
}
.mx-card-photo-empty {
  width: 78px; height: 96px; flex: none; border-radius: 8px;
  border: 2px dashed rgba(255, 255, 255, .45);
  display: grid; place-items: center; font-size: 10.5px; opacity: .7;
  text-align: center; padding: 4px; box-sizing: border-box;
}
.mx-card-fields { flex: 1; min-width: 0; }
.mx-card-no {
  font-size: 21px; font-weight: 800; letter-spacing: .04em;
  font-variant-numeric: tabular-nums; color: #ffd98a;
}
.mx-card-name {
  font-size: 15.5px; font-weight: 700; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mx-card-row { display: flex; gap: 14px; margin-top: 7px; flex-wrap: wrap; }
.mx-card-cell { min-width: 0; }
.mx-card-cell dt {
  font-size: 8.5px; text-transform: uppercase; letter-spacing: .09em;
  opacity: .66; margin: 0;
}
.mx-card-cell dd {
  margin: 1px 0 0; font-size: 12px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mx-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px 10px; font-size: 10.5px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .16);
}
.mx-card-foot .mx-card-valid { font-variant-numeric: tabular-nums; }
.mx-card-state { padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 10px; }
.mx-card-state.ok    { background: #1f9d55; color: #fff; }
.mx-card-state.warn  { background: #d9a441; color: #2b1a00; }
.mx-card-state.bad   { background: #c0392b; color: #fff; }

.mx-card-meta { margin-top: 14px; font-size: 13px; color: #64748b; }
.mx-card-meta b { color: var(--ink, #0d1c3a); }

@media print {
  /* Print the card alone: no overlay, no buttons, no panel behind it. */
  body.printing-card > *:not(#mxIdModal) { display: none !important; }
  #mxIdModal { position: static; background: none; padding: 0; overflow: visible; display: block !important; }
  #mxIdModal .dm-modal-box { box-shadow: none; max-width: none; border-radius: 0; }
  #mxIdModal .dm-modal-head, .mx-card-actions { display: none !important; }
  #mxIdModal .dm-modal-body { padding: 0; }
  .mx-card { box-shadow: none; max-width: 420px; }
}

.mx-grid dd { margin: 0 0 4px; font-size: 14px; font-weight: 600; word-break: break-word; }

.mx-photo {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f5f7fb;
}

.mx-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mx-sub {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #64748b;
}

.mx-dupe {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fbfcfe;
}

.mx-dupe .mx-why { font-size: 12.5px; color: #64748b; margin: 4px 0 8px; }
