/* =============================================================
   Seniors We Care Foundation — Beneficiary Management System
   Design system
   -------------------------------------------------------------
   Direction: a calm, dignified care-record tool.
   Deep "care" green as the brand anchor, warm gold used sparingly,
   clean humanist sans for the working UI. The Benefits Card is the
   one place we let the type turn warm and ceremonial (serif + seal).
   ============================================================= */

:root {
    --paper:        #F7F5F1;
    --surface:      #FFFFFF;
    --surface-2:    #FBFAF7;
    --ink:          #23201B;
    --muted:        #6E675C;
    --faint:        #9A9284;
    --line:         #E7E2D8;
    --line-strong:  #D8D2C5;

    --green-900:    #0A4231;
    --green:        #0E5C43;
    --green-600:    #157A5A;
    --green-tint:   #E7F0EB;

    --gold:         #B4791F;
    --gold-bright:  #C88A2D;
    --gold-tint:    #F6EAD3;

    --amber:        #A9670F;
    --amber-tint:   #FBEED6;

    --danger:       #A63C27;
    --danger-tint:  #F5E2DC;

    --info:         #2C5A78;
    --info-tint:    #E1ECF3;

    --radius:       10px;
    --radius-lg:    16px;
    --shadow-sm:    0 1px 2px rgba(35,32,27,.06);
    --shadow:       0 6px 24px -12px rgba(35,32,27,.22);
    --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif:   'Fraunces', 'Georgia', 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--paper);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }

/* ---------- Utilities ------------------------------------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono  { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.center { text-align: center; }
.right  { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* =============================================================
   ADMIN SHELL — sidebar + content
   ============================================================= */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 244px;
    flex-shrink: 0;
    background: var(--green-900);
    color: #E8EFE9;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar__brand {
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}
.sidebar__brand .mark {
    display: flex; align-items: center; gap: 10px;
}
.sidebar__brand .seal {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--gold-bright);
    display: grid; place-items: center;
    color: var(--green-900); font-weight: 700; font-family: var(--font-serif);
    font-size: 17px; flex-shrink: 0;
}
.sidebar__brand .name { font-weight: 600; font-size: 15px; line-height: 1.2; color: #fff; }
.sidebar__brand .sub  { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9BBBAA; margin-top: 2px; }

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav__label {
    font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
    color: #7FA492; padding: 14px 12px 6px;
}
.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: 8px;
    color: #D6E3DB; font-size: 14px; font-weight: 500;
    margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.active { background: var(--green-600); color: #fff; }
.nav a .ico { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.nav a .count {
    margin-left: auto; background: var(--gold-bright); color: var(--green-900);
    font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}

.sidebar__foot {
    border-top: 1px solid rgba(255,255,255,.09);
    padding: 14px 16px;
    font-size: 13px;
}
.sidebar__foot .who { color: #fff; font-weight: 500; }
.sidebar__foot .role { color: #9BBBAA; font-size: 11.5px; text-transform: capitalize; }
.sidebar__foot a { color: #C9D9D0; font-size: 13px; display: inline-block; margin-top: 8px; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 30px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 20px; }
.topbar .topbar__crumb { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.topbar .spacer { flex: 1; }

.page { padding: 26px 30px 60px; max-width: 1180px; width: 100%; }

/* ---------- Mobile menu ----------------------------------- */
.menu-toggle { display: none; }

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
    cursor: pointer; transition: background .12s, border-color .12s, transform .04s;
    text-decoration: none; line-height: 1.1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-600); color: #fff; }
.btn--gold { background: var(--gold-bright); color: var(--green-900); }
.btn--gold:hover { background: var(--gold); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--faint); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #8f331f; color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* =============================================================
   CARDS / PANELS
   ============================================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card__head {
    padding: 16px 20px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 12px;
}
.card__head h2 { font-size: 16px; }
.card__head .spacer { flex: 1; }
.card__body { padding: 20px; }
.card__body--tight { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--sidebar { grid-template-columns: 1.6fr 1fr; align-items: start; }

/* =============================================================
   STAT CARDS
   ============================================================= */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 18px 20px;
    position: relative; overflow: hidden;
}
.stat::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--green);
}
.stat--gold::before   { background: var(--gold-bright); }
.stat--amber::before  { background: var(--amber); }
.stat--info::before   { background: var(--info); }
.stat__label { font-size: 12.5px; color: var(--muted); font-weight: 500; letter-spacing: .01em; }
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__meta  { font-size: 12.5px; color: var(--faint); margin-top: 2px; }

/* =============================================================
   BADGES
   ============================================================= */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
    letter-spacing: .01em; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pending  { background: var(--amber-tint);  color: var(--amber); }
.badge--approved { background: var(--green-tint);  color: var(--green); }
.badge--rejected { background: var(--danger-tint); color: var(--danger); }
.badge--plain    { background: var(--surface-2);   color: var(--muted); }
.badge--plain::before { display: none; }

/* =============================================================
   TABLES
   ============================================================= */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
    text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--faint); font-weight: 600; padding: 12px 16px;
    border-bottom: 1px solid var(--line); background: var(--surface-2);
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .mid { color: var(--muted); }
.member-id { font-family: var(--font-sans); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--green); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: var(--green-tint); color: var(--green); display: grid; place-items: center;
    font-weight: 700; font-size: 13px;
}
.cell-person { display: flex; align-items: center; gap: 11px; }
.cell-person .nm { font-weight: 600; }
.cell-person .sub { font-size: 12.5px; color: var(--faint); }

.empty {
    text-align: center; padding: 54px 24px; color: var(--muted);
}
.empty .ico { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--line-strong); }
.empty h3 { font-size: 16px; color: var(--ink); margin-bottom: 4px; }

/* =============================================================
   FORMS
   ============================================================= */
.field { margin-bottom: 16px; }
.field > label {
    display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink);
}
.field .req { color: var(--danger); }
.field .hint { font-size: 12.5px; color: var(--faint); margin-top: 5px; }
.input, .select, .textarea {
    width: 100%; font-family: inherit; font-size: 14.5px; color: var(--ink);
    padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px;
    background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(21,122,90,.14);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.field-error { border-color: var(--danger) !important; }
.err-text { color: var(--danger); font-size: 12.5px; margin-top: 5px; }

fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend {
    font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold);
    font-weight: 700; padding: 0; margin-bottom: 14px;
    border-bottom: 1px solid var(--line); width: 100%; padding-bottom: 8px;
}

/* =============================================================
   FLASH MESSAGES
   ============================================================= */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.flash .ico { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.flash--success { background: var(--green-tint);  color: var(--green-900); border-color: #BEDBCB; }
.flash--error   { background: var(--danger-tint); color: #7c2a19; border-color: #E7BFB3; }
.flash--info    { background: var(--info-tint);   color: #1e4256; border-color: #BDD5E3; }

/* =============================================================
   DEFINITION / PROFILE
   ============================================================= */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 12px 18px; font-size: 14px; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; font-weight: 500; }

.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-head .avatar-lg {
    width: 66px; height: 66px; border-radius: 50%; background: var(--green-tint);
    color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: 24px;
    flex-shrink: 0;
}
.profile-head h1 { font-size: 24px; }
.profile-head .meta { color: var(--muted); font-size: 14px; margin-top: 3px; }

/* Timeline (activity log) */
.timeline { list-style: none; margin: 0; padding: 4px 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before {
    content: ""; position: absolute; left: 5px; top: 4px; width: 9px; height: 9px;
    border-radius: 50%; background: var(--green); border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line-strong);
}
.timeline li::after {
    content: ""; position: absolute; left: 9px; top: 14px; bottom: 0; width: 1px; background: var(--line);
}
.timeline li:last-child::after { display: none; }
.timeline .tl-action { font-weight: 600; font-size: 14px; }
.timeline .tl-detail { color: var(--muted); font-size: 13.5px; }
.timeline .tl-time { color: var(--faint); font-size: 12px; margin-top: 1px; }

/* =============================================================
   SEARCH BAR
   ============================================================= */
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; }
.searchbar .input { max-width: 340px; }

/* =============================================================
   PUBLIC — registration form + auth pages
   ============================================================= */
.public {
    min-height: 100vh; display: flex; flex-direction: column; background: var(--paper);
}
.public__nav {
    display: flex; align-items: center; gap: 12px; padding: 18px 30px;
    border-bottom: 1px solid var(--line); background: var(--surface);
}
.public__nav .mark { display: flex; align-items: center; gap: 11px; }
.public__nav .seal {
    width: 36px; height: 36px; border-radius: 50%; background: var(--green);
    color: var(--gold-bright); display: grid; place-items: center;
    font-family: var(--font-serif); font-weight: 700; font-size: 18px;
}
.public__nav .name { font-weight: 600; font-size: 15px; }
.public__nav .name span { display: block; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 500; }

.hero {
    background: var(--green-900); color: #EAF1EC;
    padding: 46px 30px; text-align: center;
}
.hero .eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-bright); font-weight: 600; }
.hero h1 { font-family: var(--font-serif); font-weight: 600; font-size: 34px; margin: 10px auto 12px; max-width: 620px; line-height: 1.15; color: #fff; }
.hero p { max-width: 560px; margin: 0 auto; color: #C6D6CC; font-size: 15.5px; }

.public__body { flex: 1; display: flex; justify-content: center; padding: 34px 20px 64px; }
.public__inner { width: 100%; max-width: 720px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.step { text-align: center; }
.step .n {
    width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 8px;
    background: var(--green-tint); color: var(--green); display: grid; place-items: center;
    font-weight: 700; font-size: 14px;
}
.step .t { font-size: 12.5px; color: var(--muted); line-height: 1.3; }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--green-900); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.auth-card__head { padding: 30px 32px 8px; text-align: center; }
.auth-card__head .seal {
    width: 52px; height: 52px; border-radius: 50%; background: var(--green);
    color: var(--gold-bright); display: grid; place-items: center; margin: 0 auto 14px;
    font-family: var(--font-serif); font-weight: 700; font-size: 26px;
}
.auth-card__head h1 { font-size: 20px; }
.auth-card__head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.auth-card__body { padding: 22px 32px 30px; }
.auth-hint { text-align: center; font-size: 12.5px; color: var(--faint); margin-top: 16px; }

/* =============================================================
   BENEFITS CARD — the signature artifact
   ============================================================= */
.card-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 12px 0; }

.benefit-card {
    width: 540px; max-width: 100%;
    border-radius: 18px; overflow: hidden;
    background:
        radial-gradient(120% 140% at 88% -10%, #12664B 0%, #0A4231 55%, #073627 100%);
    color: #EAF1EC;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,.2);
    position: relative;
}
.benefit-card::after {
    content: ""; position: absolute; inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 9px);
    pointer-events: none;
}
.bc__top {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 22px 12px;
    border-bottom: 1px solid rgba(200,138,45,.35);
    position: relative; z-index: 1;
}
.bc__seal {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: var(--gold-bright); color: var(--green-900);
    display: grid; place-items: center; font-family: var(--font-serif); font-weight: 700; font-size: 20px;
}
.bc__org { font-weight: 600; font-size: 14.5px; color: #fff; line-height: 1.15; }
.bc__org span { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-bright); margin-top: 2px; }
.bc__tag {
    margin-left: auto; font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
    color: #A9C6B7; text-align: right;
}
.bc__body { display: flex; gap: 20px; padding: 20px 22px; position: relative; z-index: 1; }
.bc__info { flex: 1; min-width: 0; }
.bc__name { font-family: var(--font-serif); font-weight: 600; font-size: 26px; color: #fff; line-height: 1.1; letter-spacing: -0.01em; }
.bc__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 16px; }
.bc__field .k { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #8FB2A1; }
.bc__field .v { font-size: 14px; font-weight: 600; color: #EAF1EC; font-variant-numeric: tabular-nums; margin-top: 2px; }
.bc__field .v.id { color: var(--gold-bright); letter-spacing: .02em; }
.bc__qr {
    width: 118px; height: 118px; flex-shrink: 0; background: #fff; border-radius: 12px;
    padding: 8px; display: grid; place-items: center;
}
.bc__qr canvas, .bc__qr img { width: 100% !important; height: 100% !important; display: block; }
.bc__foot {
    padding: 10px 22px 16px; position: relative; z-index: 1;
    font-size: 10.5px; color: #9DBBAB; border-top: 1px solid rgba(255,255,255,.08);
    display: flex; justify-content: space-between; gap: 12px;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 900px) {
    .grid--2, .grid--3, .grid--sidebar { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .sidebar {
        position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%);
        transition: transform .22s ease; box-shadow: var(--shadow);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle {
        display: inline-grid; place-items: center; width: 40px; height: 40px;
        border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface);
        cursor: pointer;
    }
    .scrim { display: none; position: fixed; inset: 0; background: rgba(10,20,15,.45); z-index: 40; }
    .scrim.show { display: block; }
    .page, .topbar { padding-left: 18px; padding-right: 18px; }
    .field-row, .field-row--3 { grid-template-columns: 1fr; }
    .dl { grid-template-columns: 1fr; gap: 3px 0; }
    .dl dt { margin-top: 10px; }
}
@media (max-width: 520px) {
    .stats { grid-template-columns: 1fr; }
    .benefit-card { width: 100%; }
    .bc__body { flex-direction: column-reverse; align-items: center; text-align: center; }
    .bc__fields { text-align: left; }
    .hero h1 { font-size: 27px; }
}

/* =============================================================
   PRINT — only the benefits card survives
   ============================================================= */
@media print {
    body { background: #fff; }
    .no-print, .sidebar, .topbar, .public__nav, .card__head, .btn-row, .scrim { display: none !important; }
    .page { padding: 0; }
    .card-stage { padding: 0; }
    .benefit-card {
        box-shadow: none; border: 1px solid #ccc;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
        page-break-inside: avoid;
    }
    @page { margin: 14mm; }
}
