/* =====================================================================
   Mangrol Memon Jamat — Member Management System
   Colours taken from the MMJ logo: royal indigo #3632A0 on white.
   ===================================================================== */
:root {
  --mmj: #3632A0;          /* logo blue */
  --mmj-dark: #27237D;
  --mmj-deep: #1A1758;
  --mmj-soft: #6E6BC0;
  --mmj-tint: #EEEDF8;
  --mmj-tint2: #DCDBF0;
  --ink: #1D1B3F;
  --ink-2: #4A4870;
  --muted: #7A7899;
  --line: #E3E2EF;
  --bg: #F6F6FB;
  --white: #FFFFFF;
  --ok: #1E8E5A;   --ok-bg: #E4F5EC;
  --warn: #A86400; --warn-bg: #FFF3DC;
  --bad: #C0392B;  --bad-bg: #FDE8E6;
  --info: #3632A0; --info-bg: #EAE9FA;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(26,23,88,.06), 0 4px 16px rgba(26,23,88,.06);
  --font: "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: var(--mmj); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--mmj-deep); line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 22px; }
h3 { font-size: 16px; letter-spacing: .2px; }
code { background: var(--mmj-tint); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); }
small { font-size: 12.5px; }
.req { color: var(--bad); }
.r { text-align: right; }
[hidden] { display: none !important; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-block; border: 1px solid transparent; border-radius: 7px; padding: 9px 18px; font: 600 14px var(--font);
  cursor: pointer; text-decoration: none !important; transition: background .15s, box-shadow .15s, color .15s; line-height: 1.3; }
.btn-primary { background: var(--mmj); color: #fff; }
.btn-primary:hover { background: var(--mmj-dark); box-shadow: 0 3px 10px rgba(54,50,160,.3); }
.btn-outline { border-color: var(--mmj); color: var(--mmj); background: #fff; }
.btn-outline:hover { background: var(--mmj-tint); }
.btn-ghost { background: transparent; color: var(--mmj); border-color: var(--line); }
.btn-ghost:hover { background: var(--mmj-tint); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { filter: brightness(.92); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-danger-ghost { background: #fff; color: var(--bad); border-color: #f0c4bf; }
.btn-danger-ghost:hover { background: var(--bad-bg); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- Forms ---------------- */
.form .field { margin-bottom: 16px; }
.field label, .field-label { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #CFCEE3; border-radius: 7px; font: 15px var(--font); color: var(--ink);
  background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mmj); box-shadow: 0 0 0 3px rgba(54,50,160,.15); }
input.caps, textarea.caps { text-transform: uppercase; }
input[type=file] { width: 100%; padding: 8px; border: 1px dashed #BEBCDD; border-radius: 7px; background: var(--mmj-tint); font-size: 13px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); background: #FFFBFA; }
.err { color: var(--bad); font-size: 13px; margin-top: 4px; }
.hint { color: var(--muted); font-size: 12.5px; display: block; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; margin: 4px 0 12px; }
.form-narrow { max-width: 380px; }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.form-inline input[type=text] { flex: 1; min-width: 140px; padding: 7px 10px; font-size: 14px; }
.form-inline .err { flex-basis: 100%; }
h3.section { margin: 26px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--mmj-tint2); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--mmj); }
h3.section small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
.grid-2 > section.card, .grid-2 > div > section.card { margin-bottom: 20px; }
.grid-wide-left { grid-template-columns: 1.6fr 1fr; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* ---------------- Alerts ---------------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border-left: 4px solid; font-size: 14.5px; }
.alert-success { background: var(--ok-bg); border-color: var(--ok); color: #135C3B; }
.alert-error { background: var(--bad-bg); border-color: var(--bad); color: #8E2318; }
.alert-warn { background: var(--warn-bg); border-color: var(--warn); color: #6D4100; }
.alert-info { background: var(--info-bg); border-color: var(--mmj); color: var(--mmj-deep); }
.note { background: var(--mmj-tint); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; color: var(--ink-2); }
.note ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------------- Badges ---------------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; vertical-align: middle; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--mmj); }
.badge-muted { background: #EEEEF3; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #D5D4E3; }
.dot-ok { background: var(--ok); }

/* =====================================================================
   AUTH LAYOUT (login / register)
   ===================================================================== */
.auth-wrap { display: flex; min-height: 100vh; }
.auth-brand { flex: 0 0 42%; background: var(--mmj); color: #fff; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 40px; }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,.12); }
.auth-brand::before { width: 620px; height: 620px; left: 50%; top: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 0 34px rgba(255,255,255,.04), 0 0 0 70px rgba(255,255,255,.03); }
.auth-brand::after { width: 900px; height: 900px; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.auth-brand-inner { position: relative; z-index: 1; text-align: center; }
.logo-disc { width: 230px; height: 230px; border-radius: 50%; background: #fff; margin: 0 auto 26px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 8px rgba(255,255,255,.18), 0 18px 40px rgba(0,0,0,.25); }
.logo-disc img { width: 68%; }
.auth-brand h1 { color: #fff; font-size: 30px; letter-spacing: 1.5px; text-transform: uppercase; margin: 0; }
.auth-brand .estb { letter-spacing: 6px; opacity: .8; margin: 6px 0 18px; font-size: 13px; }
.auth-brand .tag { display: inline-block; border-top: 1px solid rgba(255,255,255,.35); border-bottom: 1px solid rgba(255,255,255,.35);
  padding: 6px 18px; letter-spacing: 2px; text-transform: uppercase; font-size: 12.5px; }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 860px; }
.auth-card h2 { font-size: 26px; }
.auth-foot { color: var(--muted); font-size: 12.5px; margin-top: 30px; }
.auth-links { text-align: center; margin: 16px 0; font-size: 14px; }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.auth-split > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font-size: 13.5px; }
.auth-split p { margin: 4px 0 10px; color: var(--muted); }
.layout-auth .auth-card.wide { background: #fff; padding: 30px 34px; border-radius: 14px; box-shadow: var(--shadow); }

/* =====================================================================
   APP LAYOUT
   ===================================================================== */
.topbar { height: 64px; background: var(--mmj); color: #fff; display: flex; align-items: center; padding: 0 20px; gap: 14px;
  position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(26,23,88,.25); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff !important; text-decoration: none !important; }
.brand-logo { width: 46px; height: 46px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.brand-logo img { width: 32px; }
.brand-text { font-weight: 700; font-size: 17px; letter-spacing: .6px; text-transform: uppercase; line-height: 1.15; }
.brand-text small { display: block; font-weight: 400; text-transform: none; letter-spacing: .5px; font-size: 12px; opacity: .8; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-user .who { text-align: right; font-size: 14px; font-weight: 600; line-height: 1.2; }
.topbar-user .who small { display: block; font-weight: 400; opacity: .75; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.12); }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; }

.shell { display: flex; min-height: calc(100vh - 64px); }
.sidebar { width: 236px; flex: 0 0 236px; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 14.5px;
  text-decoration: none; margin-bottom: 2px; position: relative; }
.sidebar li a:hover { background: var(--mmj-tint); color: var(--mmj); }
.sidebar li a.active { background: var(--mmj-tint); color: var(--mmj); }
.sidebar li a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--mmj); }
.sidebar .count { margin-left: auto; background: var(--mmj); color: #fff; border-radius: 20px; font-size: 11.5px; padding: 1px 8px; }
.switch-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.switch-box a { display: block; padding: 8px 12px; background: var(--mmj-tint); border-radius: 8px; font-weight: 600; }
.side-foot { margin-top: auto; text-align: center; color: var(--mmj-soft); letter-spacing: 4px; font-size: 11px; padding-top: 20px; }
.content { flex: 1; padding: 26px 30px 50px; min-width: 0; max-width: 1280px; }

/* icons (SVG masks, inherit colour) */
.ico { width: 18px; height: 18px; flex: 0 0 18px; background: currentColor; -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; }
.ico-grid { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z'/%3E%3C/svg%3E"); }
.ico-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.5'/%3E%3Cpath d='M3 21c0-4.4 4-7.5 9-7.5s9 3.1 9 7.5z'/%3E%3C/svg%3E"); }
.ico-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Ccircle cx='17.5' cy='9' r='3'/%3E%3Cpath d='M1 20c0-3.9 3.6-6.5 8-6.5s8 2.6 8 6.5zM17 13.6c3.3.1 6 2.2 6 5.4h-4.5c0-2-.6-3.8-1.5-5.4z'/%3E%3C/svg%3E"); }
.ico-user-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='8' r='4.5'/%3E%3Cpath d='M1 21c0-4.4 3.6-7.5 8-7.5s8 3.1 8 7.5zM19 7h2v3h3v2h-3v3h-2v-3h-3v-2h3z'/%3E%3C/svg%3E"); }
.ico-alert { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H9l-5 4v-4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm7 3v6h2V6zm0 8v2h2v-2z'/%3E%3C/svg%3E"); }
.ico-gift { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.2-8-11.2C4 6.6 6.4 4.5 9 4.5c1.4 0 2.4.7 3 1.6.6-.9 1.6-1.6 3-1.6 2.6 0 5 2.1 5 5.3C20 15.8 12 21 12 21z'/%3E%3C/svg%3E"); }
.ico-star { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.5 7 .8-5.2 4.8 1.4 7L12 17.6 5.8 21l1.4-7L2 9.3l7-.8z'/%3E%3C/svg%3E"); }
.ico-mail { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 5h20v14H2zm2 2v.5l8 5 8-5V7l-8 5z'/%3E%3C/svg%3E"); }

/* ---------------- Cards, tables ---------------- */
.page-title { font-size: 24px; margin-bottom: 6px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.page-head h2, .page-head h1 { margin: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-flush { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td, .table th { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.table tr:last-child td { border-bottom: 0; }
.table-list thead th { background: var(--mmj-tint); color: var(--mmj-deep); font-size: 12px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; border-bottom: 2px solid var(--mmj-tint2); }
.table-list tbody tr:hover { background: #FAFAFE; }
.table td.r, .table th.r { text-align: right; }
.row-hl { background: #FBFAFF; box-shadow: inset 4px 0 0 var(--mmj); }
.row-off td { opacity: .55; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 7px 14px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }
.dl-inline { grid-template-columns: auto 1fr auto 1fr; margin-bottom: 14px; }
.mini-row { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.mini-row:last-child { border-bottom: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; background: #fff; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); }
.toolbar input[type=search] { flex: 1 1 220px; width: auto; padding: 8px 10px; }
.toolbar select { width: auto; padding: 8px 10px; font-size: 14px; }
.toolbar .check { margin: 0 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; align-items: center; }
.chip { padding: 5px 13px; border-radius: 20px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none !important; }
.chip em { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 3px; }
.chip.on { background: var(--mmj); border-color: var(--mmj); color: #fff; }
.chip.on em { color: rgba(255,255,255,.75); }
.inline-search { margin-left: auto; }
.inline-search input { padding: 6px 10px; font-size: 13.5px; width: 240px; }
.pager { display: flex; gap: 4px; justify-content: center; margin: 10px 0 20px; }
.pager a, .pager span { padding: 6px 12px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.pager .current { background: var(--mmj); color: #fff; border-color: var(--mmj); }

/* ---------------- Stats ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 18px 0 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink) !important;
  text-decoration: none !important; position: relative; overflow: hidden; transition: transform .15s; }
.stat:hover { transform: translateY(-2px); }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; border: 10px solid var(--mmj-tint); }
.stat b { display: block; font-size: 30px; color: var(--mmj); line-height: 1.1; }
.stat span { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.stat em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.stat-action { background: var(--mmj); border-color: var(--mmj); }
.stat-action b, .stat-action span { color: #fff; }
.stat-action::after { border-color: rgba(255,255,255,.12); }

.type-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.type-stat { border-radius: 9px; padding: 12px; background: var(--mmj-tint); color: var(--ink) !important; text-decoration: none !important; border-top: 4px solid var(--mmj); }
.type-stat b { display: block; font-size: 24px; color: var(--mmj-deep); }
.type-stat .ts-label { font-weight: 700; font-size: 13px; color: var(--mmj); }
.type-stat small { color: var(--muted); font-size: 11.5px; }
.type-stat.type-education_help { border-top-color: #3632A0; }
.type-stat.type-marriage { border-top-color: #8A5CC7; }
.type-stat.type-monthly_aid { border-top-color: #2F7FBF; }
.type-stat.type-medical { border-top-color: #C0392B; }
.type-stat.type-house_aid { border-top-color: #1E8E5A; }
.type-stat.type-others { border-top-color: #7A7899; }

.bars .bar-row { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 10px; font-size: 13.5px; margin-bottom: 6px; }
.bar { height: 10px; background: var(--mmj-tint); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--mmj); border-radius: 6px; }
.bars b { text-align: right; color: var(--mmj-deep); }

/* ---------------- Member card ---------------- */
.member-card { display: flex; align-items: center; gap: 22px; background: var(--mmj); color: #fff; border-radius: 14px; padding: 22px 26px; margin-bottom: 22px;
  position: relative; overflow: hidden; box-shadow: 0 8px 24px rgba(54,50,160,.25); flex-wrap: wrap; }
.member-card::before { content: ""; position: absolute; right: -90px; top: -90px; width: 300px; height: 300px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15); box-shadow: 0 0 0 26px rgba(255,255,255,.04); }
.member-card h1 { color: #fff; margin: 0; font-size: 24px; letter-spacing: .5px; }
.member-card p { margin: 2px 0; opacity: .9; }
.member-card .mc-meta { font-size: 13.5px; opacity: .85; }
.member-card .mc-meta .badge { background: rgba(255,255,255,.18); color: #fff; }
.mc-code { display: inline-block; background: #fff; color: var(--mmj); font-weight: 800; padding: 2px 10px; border-radius: 5px; letter-spacing: 1px; font-size: 13px; margin-bottom: 4px; }
.mc-body { position: relative; z-index: 1; flex: 1; min-width: 220px; }
.mc-seal { margin-left: auto; width: 74px; height: 74px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 11px; letter-spacing: 2px; font-weight: 700; line-height: 1.3; position: relative; z-index: 1; }
.mc-actions { margin-left: auto; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.mc-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
.mc-actions .btn-ghost:hover { background: rgba(255,255,255,.12); }
.avatar { border-radius: 50%; object-fit: cover; background: var(--mmj-tint); flex: 0 0 auto; position: relative; z-index: 1; }
.avatar-lg { width: 92px; height: 92px; border: 4px solid rgba(255,255,255,.85); }
.avatar-md { width: 46px; height: 46px; }
.avatar-ini { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--mmj); background: #fff; }
.avatar-md.avatar-ini { background: var(--mmj-tint); font-size: 15px; }
.avatar-lg.avatar-ini { font-size: 30px; }

/* ---------------- Documents ---------------- */
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.doc-thumb { display: flex; align-items: center; justify-content: center; height: 120px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  overflow: hidden; margin: 4px 0 8px; font-size: 13px; color: var(--mmj); font-weight: 600; }
.doc-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.doc-thumb.empty { color: var(--muted); font-weight: 400; border-style: dashed; }

/* ---------------- Messages ---------------- */
.msg { border-radius: 10px; padding: 12px 16px; margin: 10px 0; font-size: 14.5px; max-width: 88%; }
.msg-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.msg-member { background: var(--bg); border: 1px solid var(--line); }
.msg-admin { background: var(--mmj-tint); border: 1px solid var(--mmj-tint2); margin-left: auto; }
.msg-admin .msg-head { color: var(--mmj); }
.msg-info { border-left: 4px solid var(--mmj); }
.reply-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------------- Approvals, bearers ---------------- */
.approval-row { padding: 10px 0; border-bottom: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.approval-row > span:first-child { font-weight: 700; min-width: 150px; }
.approval-row .remarks { flex-basis: 100%; background: var(--bg); padding: 6px 10px; border-radius: 6px; font-size: 13.5px; }
.decision-form { margin-top: 16px; }
.bearer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.bearer-title { font-weight: 800; color: var(--mmj); text-transform: uppercase; letter-spacing: 1px; font-size: 14px; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.bearer-who { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }

/* ---------------- Facility type picker ---------------- */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-opt { border: 2px solid var(--line); border-radius: 9px; padding: 14px 12px; cursor: pointer; text-align: center; font-weight: 700; color: var(--ink-2); background: #fff; transition: all .15s; }
.type-opt input { display: none; }
.type-opt:hover { border-color: var(--mmj-soft); }
.type-opt.on { border-color: var(--mmj); background: var(--mmj-tint); color: var(--mmj); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .type-stats { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .auth-wrap { flex-direction: column; }
  .auth-brand { flex: none; padding: 28px 20px; }
  .logo-disc { width: 120px; height: 120px; margin-bottom: 12px; }
  .auth-brand h1 { font-size: 20px; }
  .auth-brand .tag { display: none; }
  .grid-2, .grid-3, .grid-wide-left { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .nav-toggle { display: block; }
  .sidebar { position: fixed; left: -260px; top: 64px; bottom: 0; z-index: 15; transition: left .2s; box-shadow: 4px 0 20px rgba(0,0,0,.1); }
  .nav-open .sidebar { left: 0; }
  .content { padding: 18px 14px 40px; }
  .topbar-user .who { display: none; }
  .brand-text { font-size: 14px; }
  .dl { grid-template-columns: 130px 1fr; }
  .dl-inline { grid-template-columns: auto 1fr; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .msg { max-width: 100%; }
  .inline-search { margin-left: 0; }
  .doc-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .stats, .type-stats { grid-template-columns: 1fr 1fr; }
  .auth-split { grid-template-columns: 1fr; }
  .mc-seal { display: none; }
}

/* Member Managing Committee */
.committee { margin-top: 20px; }
.committee-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.committee-row form { margin-left: auto; }

/* CAPTCHA */
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.captcha-img { border-radius: 7px; display: block; background: var(--mmj-tint); }
.captcha-q { font-size: 16px; margin-bottom: 8px; color: var(--ink); }
.captcha input[name=captcha] { text-transform: uppercase; letter-spacing: 3px; max-width: 220px; }

/* Family */
.family-summary { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.family-summary span { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 5px 14px; font-size: 13.5px; color: var(--ink-2); }
.family-summary b { color: var(--mmj); font-size: 15px; margin-right: 3px; }
.inline-form { display: inline; }
.nowrap { white-space: nowrap; }
