/* ===========================================================================
   WEFAS CRM — application shell.
   Palette: the navy of the WEFAS wordmark on white, one blue accent.
   Everything here is mobile-first; the sidebar becomes a drawer below 1024px.
   =========================================================================== */

:root {
    --wf-navy:      #1E2A6E;   /* logo wordmark navy — headers, primary buttons */
    --wf-navy-dark: #16205A;
    --wf-navy-soft: #EEF1FA;   /* tinted panel background */
    --wf-blue:      #2B6FD6;   /* accent: links, focus rings, active menu */
    --wf-blue-soft: #E7F0FD;

    --wf-ink:       #16233A;   /* body text */
    --wf-muted:     #6B7A90;
    --wf-line:      #DCE3ED;
    --wf-canvas:    #F4F7FC;   /* page background */
    --wf-white:     #FFFFFF;

    --wf-green:     #1D8A55;
    --wf-green-soft:#E6F6EE;
    --wf-amber:     #B7791F;
    --wf-amber-soft:#FDF5E4;
    --wf-red:       #B3261E;
    --wf-red-soft:  #FBEBEA;

    --wf-radius:    12px;
    --wf-shadow:    0 2px 10px rgba(16, 30, 60, .06);
    --wf-shadow-lg: 0 18px 40px rgba(16, 30, 60, .16);
    --wf-side-w:    268px;
    --wf-top-h:     60px;
}

* { box-sizing: border-box; }

/* An element with an inline display (grid rows, flex boxes) must still disappear when hidden. */
[hidden] { display: none !important; }

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

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans Gujarati", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--wf-ink);
    background: var(--wf-canvas);
}

a { color: var(--wf-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 10px; color: var(--wf-navy); font-weight: 700; line-height: 1.25; }
h1 { font-size: 1.32rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }

/* ========================================================== app shell ==== */

.wf-shell { min-height: 100vh; }

/* ---- top bar ---- */
.wf-top {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--wf-top-h);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    background: var(--wf-navy);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.wf-top__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wf-top__logo {
    height: 38px; width: 38px; flex: none;
    background: #fff; border-radius: 9px; padding: 3px;
    object-fit: contain;
}
.wf-top__name { font-weight: 700; font-size: 1.02rem; letter-spacing: .3px; white-space: nowrap; }
.wf-top__tag  { font-size: .72rem; opacity: .75; white-space: nowrap; }
.wf-top__spacer { flex: 1; }

.wf-burger {
    display: none;
    width: 40px; height: 40px; flex: none;
    align-items: center; justify-content: center;
    background: rgba(255,255,255,.12);
    border: 0; border-radius: 10px;
    color: #fff; cursor: pointer;
}
.wf-burger svg { width: 20px; height: 20px; }

/* ---- the user chip ---- */
.wf-me { position: relative; }
.wf-me__btn {
    display: flex; align-items: center; gap: 9px;
    background: rgba(255,255,255,.1);
    border: 0; border-radius: 999px;
    padding: 5px 12px 5px 5px;
    color: #fff; font: inherit; cursor: pointer;
}
.wf-me__btn:hover { background: rgba(255,255,255,.18); }
.wf-me__av {
    width: 30px; height: 30px; flex: none;
    display: grid; place-items: center;
    background: var(--wf-blue); border-radius: 50%;
    font-size: .8rem; font-weight: 700;
}
.wf-me__txt { text-align: start; line-height: 1.15; }
.wf-me__txt b { display: block; font-size: .84rem; font-weight: 600; }
.wf-me__txt span { font-size: .7rem; opacity: .75; }
.wf-me__pop {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    min-width: 210px; padding: 7px;
    background: #fff; border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius); box-shadow: var(--wf-shadow-lg);
    display: none; z-index: 70;
}
.wf-me.is-open .wf-me__pop { display: block; }
.wf-me__pop a, .wf-me__pop button {
    display: flex; align-items: center; gap: 9px;
    width: 100%; padding: 9px 11px;
    background: transparent; border: 0; border-radius: 9px;
    font: inherit; font-size: .9rem; color: var(--wf-ink);
    text-align: start; text-decoration: none; cursor: pointer;
}
.wf-me__pop a:hover, .wf-me__pop button:hover { background: var(--wf-canvas); text-decoration: none; }
.wf-me__pop hr { border: 0; border-top: 1px solid var(--wf-line); margin: 5px 0; }

/* ---- sidebar ---- */
.wf-side {
    position: fixed;
    top: var(--wf-top-h); bottom: 0; inset-inline-start: 0;
    width: var(--wf-side-w);
    z-index: 55;
    background: #fff;
    border-inline-end: 1px solid var(--wf-line);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 10px 0;
    display: flex;
    flex-direction: column;
}

/* Logout sits at the foot of the menu and stays there while the menu scrolls. */
.wf-side__foot {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: 10px 0 12px;
    background: #fff;
    border-top: 1px solid var(--wf-line);
}
.wf-logout {
    width: 100%;
    display: flex; align-items: center; gap: 10px;
    font: inherit; font-size: .88rem; font-weight: 600;
    color: var(--wf-red);
    background: transparent; border: 0; border-radius: 9px;
    padding: 10px 12px; min-height: 42px;
    cursor: pointer; text-align: start;
}
.wf-logout:hover { background: var(--wf-red-soft); }
.wf-logout .wf-ic { width: 17px; height: 17px; flex: 0 0 auto; }
.wf-side__search { position: relative; margin: 2px 4px 12px; }
.wf-side__search input {
    width: 100%; font: inherit; font-size: .88rem;
    padding: 9px 12px 9px 34px;
    border: 1px solid var(--wf-line); border-radius: 999px;
    background: var(--wf-canvas); color: var(--wf-ink);
}
.wf-side__search input:focus { outline: 0; border-color: var(--wf-blue); background: #fff; }
.wf-side__search svg {
    position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; color: var(--wf-muted); pointer-events: none;
}

.wf-grp { margin-bottom: 3px; }
.wf-grp__btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 11px;
    background: transparent; border: 0; border-radius: 10px;
    font: inherit; font-size: .9rem; font-weight: 600; color: var(--wf-ink);
    text-align: start; cursor: pointer;
}
.wf-grp__btn:hover { background: var(--wf-canvas); }
.wf-grp__btn svg.wf-ic { width: 17px; height: 17px; flex: none; color: var(--wf-navy); }
.wf-grp__label { flex: 1; min-width: 0; }
.wf-grp__n {
    font-size: .68rem; font-weight: 700; color: var(--wf-muted);
    background: var(--wf-canvas); border-radius: 999px; padding: 2px 7px;
}
.wf-grp__chev { width: 14px; height: 14px; flex: none; color: var(--wf-muted); transition: transform .2s ease; }
.wf-grp.is-open .wf-grp__chev { transform: rotate(180deg); }

.wf-grp__items { display: none; padding: 2px 0 6px 12px; margin-inline-start: 13px; border-inline-start: 1px solid var(--wf-line); }
.wf-grp.is-open .wf-grp__items { display: block; }

.wf-mi {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; margin: 1px 0;
    border-radius: 8px;
    font-size: .855rem; color: var(--wf-ink); text-decoration: none;
}
.wf-mi:hover { background: var(--wf-blue-soft); color: var(--wf-navy); text-decoration: none; }
.wf-mi.is-active { background: var(--wf-navy); color: #fff; font-weight: 600; }
.wf-mi__label { flex: 1; min-width: 0; }
.wf-mi__soon {
    font-size: .62rem; font-weight: 700; letter-spacing: .04em;
    color: var(--wf-amber); background: var(--wf-amber-soft);
    border-radius: 5px; padding: 1px 5px; flex: none;
}
.wf-mi.is-active .wf-mi__soon { background: rgba(255,255,255,.2); color: #fff; }

/* ---- main ---- */
.wf-main {
    padding: calc(var(--wf-top-h) + 18px) 20px 40px;
    margin-inline-start: var(--wf-side-w);
    min-height: 100vh;
}

.wf-page {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 12px; margin-bottom: 16px;
}
.wf-page__crumb { font-size: .78rem; color: var(--wf-muted); margin-bottom: 2px; }
.wf-page__title { margin: 0; }
.wf-page__hint { font-size: .82rem; color: var(--wf-muted); margin-top: 2px; }
.wf-page__act { display: flex; gap: 8px; flex-wrap: wrap; }

.wf-card {
    background: #fff;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow);
    padding: 18px;
    margin-bottom: 16px;
}
.wf-card__head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: -18px -18px 16px; padding: 13px 18px;
    border-bottom: 1px solid var(--wf-line);
    background: var(--wf-navy-soft);
    border-radius: var(--wf-radius) var(--wf-radius) 0 0;
}
.wf-card__head h2, .wf-card__head h3 { margin: 0; }
.wf-card--flush { padding: 0; }
.wf-card--flush .wf-card__head { margin: 0; border-radius: var(--wf-radius) var(--wf-radius) 0 0; }

/* ---- buttons ---- */
.wf-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font: inherit; font-size: .88rem; font-weight: 600;
    padding: 9px 16px; min-height: 40px;
    border: 1px solid var(--wf-line); border-radius: 10px;
    background: #fff; color: var(--wf-ink);
    cursor: pointer; text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.wf-btn:hover { border-color: var(--wf-blue); color: var(--wf-blue); text-decoration: none; }
.wf-btn svg { width: 16px; height: 16px; flex: none; }
.wf-btn--primary { background: var(--wf-navy); border-color: var(--wf-navy); color: #fff; }
.wf-btn--primary:hover { background: var(--wf-navy-dark); border-color: var(--wf-navy-dark); color: #fff; }
.wf-btn--danger { color: var(--wf-red); border-color: #F0CFCD; background: var(--wf-red-soft); }
.wf-btn--danger:hover { background: var(--wf-red); border-color: var(--wf-red); color: #fff; }
.wf-btn--sm { min-height: 32px; padding: 5px 11px; font-size: .8rem; border-radius: 8px; }
.wf-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- forms ---- */
.wf-form { display: grid; gap: 15px; }
.wf-row { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.wf-row--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.wf-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wf-f > label { font-size: .8rem; font-weight: 600; color: var(--wf-muted); }
.wf-f > label .req { color: var(--wf-red); }
.wf-f__hint { font-size: .74rem; color: var(--wf-muted); }

.wf-in, .wf-f input[type=text], .wf-f input[type=email], .wf-f input[type=password],
.wf-f input[type=number], .wf-f input[type=date], .wf-f input[type=file], .wf-f textarea, .wf-f select {
    width: 100%; font: inherit; font-size: .93rem;
    padding: 10px 13px; min-height: 42px;
    color: var(--wf-ink); background: #fff;
    border: 1.5px solid var(--wf-line); border-radius: 10px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.wf-in:focus, .wf-f input:focus, .wf-f textarea:focus, .wf-f select:focus {
    outline: 0; border-color: var(--wf-blue); box-shadow: 0 0 0 3px rgba(43,111,214,.14);
}
.wf-f textarea { min-height: 84px; resize: vertical; }

.wf-check { display: flex; align-items: center; gap: 9px; font-size: .9rem; cursor: pointer; }
.wf-check input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--wf-navy); flex: none; }

.wf-actions { display: flex; gap: 9px; flex-wrap: wrap; padding-top: 4px; }

.field-validation-error, .wf-err { color: var(--wf-red); font-size: .78rem; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 18px; }
.input-validation-error { border-color: var(--wf-red) !important; }

/* ---- searchable combo (EVERY dropdown in this project) ---- */
.wf-sr {
    position: absolute !important; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wf-combo { position: relative; }
.wf-combo__control {
    width: 100%; display: flex; align-items: center; gap: 9px;
    padding: 10px 13px; min-height: 42px; cursor: pointer; text-align: start;
    background: #fff; border: 1.5px solid var(--wf-line); border-radius: 10px;
    font: inherit; font-size: .93rem; color: var(--wf-ink);
}
.wf-combo__control:focus, .wf-combo.is-open .wf-combo__control {
    outline: 0; border-color: var(--wf-blue); box-shadow: 0 0 0 3px rgba(43,111,214,.14);
}
.wf-combo__value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-combo__value.is-placeholder { color: #A9B2C2; }
.wf-combo__caret { width: 16px; height: 16px; flex: none; color: var(--wf-muted); transition: transform .22s ease; }
.wf-combo.is-open .wf-combo__caret { transform: rotate(180deg); }
.wf-combo__panel {
    position: absolute; top: calc(100% + 5px); inset-inline: 0; z-index: 50;
    background: #fff; border: 1px solid var(--wf-line); border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow-lg); padding: 7px; display: none;
}
.wf-combo.is-open .wf-combo__panel { display: block; }
.wf-combo__search {
    width: 100%; padding: 9px 12px; margin-bottom: 5px;
    border: 1.5px solid var(--wf-line); border-radius: 8px; font: inherit; font-size: .9rem;
}
.wf-combo__search:focus { outline: 0; border-color: var(--wf-blue); }
.wf-combo__list { max-height: 240px; overflow-y: auto; }
.wf-combo__opt { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: .92rem; }
.wf-combo__opt:hover, .wf-combo__opt.is-cursor { background: var(--wf-canvas); }
.wf-combo__opt.is-selected { background: var(--wf-blue-soft); color: var(--wf-navy); font-weight: 700; }
.wf-combo__empty { padding: 15px; text-align: center; color: var(--wf-muted); font-size: .88rem; }

/* ---- alerts ---- */
.wf-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 15px; margin-bottom: 15px;
    border: 1px solid; border-radius: var(--wf-radius);
    font-size: .89rem;
}
.wf-alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.wf-alert--ok   { background: var(--wf-green-soft); border-color: #BFE5D1; color: #14603C; }
.wf-alert--err  { background: var(--wf-red-soft);   border-color: #F0CFCD; color: #8A1E18; }
.wf-alert--info { background: var(--wf-blue-soft);  border-color: #C6DCF8; color: #17457F; }
.wf-alert--warn { background: var(--wf-amber-soft); border-color: #EBD9AC; color: #7A5410; }

/* ---- pills ---- */
.wf-pill {
    display: inline-block; font-size: .72rem; font-weight: 700;
    padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.wf-pill--on   { background: var(--wf-green-soft); color: var(--wf-green); }
.wf-pill--off  { background: #EEF1F5; color: var(--wf-muted); }
.wf-pill--navy { background: var(--wf-navy-soft); color: var(--wf-navy); }
.wf-pill--warn { background: var(--wf-amber-soft); color: var(--wf-amber); }

/* ---- stat cards ---- */
.wf-stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.wf-stat {
    background: #fff; border: 1px solid var(--wf-line); border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow); padding: 15px 17px;
    display: flex; align-items: center; gap: 13px;
}
.wf-stat__ic {
    width: 42px; height: 42px; flex: none; display: grid; place-items: center;
    background: var(--wf-navy-soft); color: var(--wf-navy); border-radius: 11px;
}
.wf-stat__ic svg { width: 21px; height: 21px; }
.wf-stat__n { font-size: 1.5rem; font-weight: 800; color: var(--wf-navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.wf-stat__l { font-size: .78rem; color: var(--wf-muted); }

/* Dashboard: larger cards so a full ₹ amount (₹12,34,56,789.00) never gets cut. */
.wf-stats--dash { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.wf-stats--dash .wf-stat { padding: 22px 22px; gap: 16px; min-height: 104px; transition: box-shadow .15s, transform .15s; }
.wf-stats--dash a.wf-stat:hover { box-shadow: var(--wf-shadow-lg); transform: translateY(-2px); }
.wf-stats--dash .wf-stat > div:last-child { min-width: 0; }
.wf-stats--dash .wf-stat__ic { width: 54px; height: 54px; border-radius: 14px; }
.wf-stats--dash .wf-stat__ic svg { width: 26px; height: 26px; }
.wf-stats--dash .wf-stat__n { font-size: 1.75rem; overflow-wrap: anywhere; }
.wf-stats--dash .wf-stat__l { font-size: .86rem; margin-top: 3px; }

/* Dashboard charts: two per row on a desktop, one per row on a phone. */
.wf-charts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); margin-bottom: 18px; }
.wf-chart { margin: 0; }
.wf-chart__box { position: relative; height: 300px; }
.wf-chart__box .wf-empty { height: 100%; display: grid; place-items: center; }
@media (max-width: 560px) {
    .wf-charts { grid-template-columns: 1fr; }
    .wf-chart__box { height: 260px; }
    .wf-stats--dash .wf-stat { padding: 16px; min-height: 0; }
    .wf-stats--dash .wf-stat__n { font-size: 1.4rem; }
}

/* ---- tables (base look; grid.js adds the behaviour) ---- */
.wf-tablewrap {
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius);
    background: #fff;
    overflow-x: auto;
}
.wf-table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.wf-table th, .wf-table td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--wf-line); }
.wf-table thead th {
    background: var(--wf-navy-soft); color: var(--wf-navy);
    font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.wf-table tbody tr:last-child td { border-bottom: 0; }
.wf-table tbody tr:hover { background: var(--wf-canvas); }
.wf-table .wf-rowact { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- empty state ---- */
.wf-empty { padding: 42px 20px; text-align: center; color: var(--wf-muted); }
.wf-empty svg { width: 40px; height: 40px; color: var(--wf-line); margin-bottom: 8px; }

/* ---- rights matrix ---- */
.wf-matrix th.wf-mx { text-align: center; width: 78px; }
.wf-matrix td.wf-mx { text-align: center; }
.wf-matrix input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--wf-navy); }
.wf-matrix tr.wf-mxgrp td {
    background: var(--wf-navy); color: #fff;
    font-weight: 700; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase;
    position: sticky; top: 38px; z-index: 1;
}
.wf-matrix tr.wf-mxgrp td a { color: #fff; font-size: .72rem; font-weight: 600; text-transform: none; letter-spacing: 0; opacity: .85; }
.wf-mx__inherit { font-size: .66rem; color: var(--wf-muted); display: block; }

/* ---- auth page ---- */
.wf-auth {
    min-height: 100vh; display: grid; place-items: center; padding: 26px 16px;
    background: linear-gradient(140deg, var(--wf-navy) 0%, var(--wf-navy-dark) 45%, #101841 100%);
}
.wf-auth__box {
    width: 100%; max-width: 410px;
    background: #fff; border-radius: 18px; box-shadow: var(--wf-shadow-lg);
    padding: 30px 28px 26px;
}
.wf-auth__logo { display: block; height: 88px; margin: 0 auto 14px; object-fit: contain; }
.wf-auth__title { text-align: center; margin-bottom: 3px; }
.wf-auth__sub { text-align: center; color: var(--wf-muted); font-size: .85rem; margin-bottom: 20px; }
.wf-auth__foot { text-align: center; font-size: .75rem; color: var(--wf-muted); margin-top: 18px; }

/* ---- "coming soon" page ---- */
.wf-soon { text-align: center; padding: 30px 18px; }
.wf-soon__ic {
    width: 62px; height: 62px; margin: 0 auto 14px; display: grid; place-items: center;
    background: var(--wf-navy-soft); color: var(--wf-navy); border-radius: 18px;
}
.wf-soon__ic svg { width: 30px; height: 30px; }
.wf-soon__phase { display: inline-block; margin: 8px 0 14px; }

/* ================================================= Phase 1: money ======== */

.wf-neg { color: var(--wf-red) !important; font-weight: 700; }
.wf-pos { color: var(--wf-green); }
.wf-muted { color: var(--wf-muted); }
.wf-row-bad td { background: var(--wf-red-soft) !important; }

/* bulk upload steps */
.wf-steps { display: grid; gap: 12px; margin-bottom: 16px; }
.wf-step {
    display: flex; gap: 14px; align-items: flex-start;
    background: #fff; border: 1px solid var(--wf-line); border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow); padding: 16px 18px;
}
.wf-step h3 { margin: 2px 0 4px; }
.wf-step p { margin: 0 0 10px; color: var(--wf-muted); font-size: .88rem; }
.wf-step__n {
    width: 34px; height: 34px; flex: none; display: grid; place-items: center;
    background: var(--wf-navy); color: #fff; border-radius: 50%; font-weight: 800;
}

/* tile list (bulk center, quick actions) */
.wf-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.wf-tile {
    display: flex; align-items: center; gap: 13px; padding: 15px 16px;
    background: #fff; border: 1px solid var(--wf-line); border-radius: var(--wf-radius);
    box-shadow: var(--wf-shadow); color: var(--wf-ink); text-decoration: none;
}
.wf-tile:hover { border-color: var(--wf-blue); text-decoration: none; }
.wf-tile b { display: block; color: var(--wf-navy); }
.wf-tile span { font-size: .8rem; color: var(--wf-muted); }

/* the money entry form's live calculation panel */
.wf-calc {
    display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    background: var(--wf-navy-soft); border: 1px solid #D5DCEE; border-radius: var(--wf-radius);
    padding: 13px 15px;
}
.wf-calc__k { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--wf-muted); }
.wf-calc__v { font-size: 1.15rem; font-weight: 800; color: var(--wf-navy); font-variant-numeric: tabular-nums; }
.wf-calc__v small { font-size: .75rem; font-weight: 600; color: var(--wf-muted); }
.wf-calc__formula { grid-column: 1 / -1; font-size: .82rem; color: var(--wf-navy); }

.wf-seg { display: inline-flex; border: 1.5px solid var(--wf-line); border-radius: 10px; overflow: hidden; }
.wf-seg label { margin: 0; }
.wf-seg input { position: absolute; opacity: 0; pointer-events: none; }
.wf-seg span {
    display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px;
    font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--wf-ink); background: #fff;
}
.wf-seg input:checked + span { background: var(--wf-navy); color: #fff; }
.wf-seg label + label span { border-inline-start: 1px solid var(--wf-line); }

/* voucher */
.wf-voucher { max-width: 760px; }
.wf-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 20px; }
.wf-kv div { min-width: 0; }
.wf-kv dt { font-size: .74rem; font-weight: 700; color: var(--wf-muted); text-transform: uppercase; letter-spacing: .04em; }
.wf-kv dd { margin: 2px 0 0; font-size: .95rem; word-break: break-word; }
.wf-pill--red { background: var(--wf-red-soft); color: var(--wf-red); }

.wf-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.wf-filter .wf-f { flex: 1 1 170px; }
.wf-filter .wf-f--wide { flex: 2 1 260px; }

/* ================================================== responsive / mobile ==== */

@media (max-width: 1023px) {
    .wf-burger { display: inline-flex; }
    .wf-side {
        transform: translateX(-100%);
        transition: transform .24s ease;
        box-shadow: var(--wf-shadow-lg);
        width: min(300px, 86vw);
    }
    .wf-side.is-open { transform: none; }
    .wf-main { margin-inline-start: 0; padding-inline: 14px; }
    .wf-scrim {
        position: fixed; inset: var(--wf-top-h) 0 0 0; z-index: 54;
        background: rgba(16,30,60,.42);
        opacity: 0; pointer-events: none; transition: opacity .2s ease;
    }
    .wf-scrim.is-open { opacity: 1; pointer-events: auto; }
}

@media (max-width: 620px) {
    :root { --wf-top-h: 56px; }
    body { font-size: 14px; }
    .wf-top__tag { display: none; }
    .wf-me__txt { display: none; }
    .wf-me__btn { padding: 5px; }
    .wf-page { align-items: stretch; }
    .wf-page__act { width: 100%; }
    .wf-page__act .wf-btn { flex: 1; }
    .wf-card { padding: 14px; border-radius: 10px; }
    .wf-card__head { margin: -14px -14px 13px; padding: 11px 14px; }
    .wf-stat__n { font-size: 1.3rem; }
    /* Touch targets stay at least 42px high on a phone. */
    .wf-btn { min-height: 42px; }
    /* Balance before / after reads as a 2 × 2 block instead of four stacked rows. */
    .wf-calc { grid-template-columns: 1fr 1fr; }
    .wf-calc__v { font-size: 1rem; }
    .wf-seg span { padding: 8px 12px; }
}

/* ================================================================ print ==== */
@media print {
    .wf-top, .wf-side, .wf-scrim, .wf-page__act, .wf-gridbar, .wf-pager, .wf-noprint { display: none !important; }
    .wf-main { margin: 0; padding: 0; }
    .wf-card { border: 0; box-shadow: none; padding: 0; }
    body { background: #fff; }
}

/* ===========================================================================
   View Guide — the help panel every screen carries.
   The button sits in the top bar; the panel slides in from the end side and
   scrolls on its own, so the page underneath keeps its place.
   =========================================================================== */
.wf-guidebtn {
    display: inline-flex; align-items: center; gap: 7px;
    font: inherit; font-size: .84rem; font-weight: 600;
    color: #fff; background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
    padding: 7px 14px; min-height: 36px; cursor: pointer;
    margin-inline-end: 10px; white-space: nowrap;
}
.wf-guidebtn:hover { background: rgba(255,255,255,.24); }
.wf-guidebtn .wf-ic { width: 16px; height: 16px; }

.wf-guide__scrim {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(16,30,60,.45);
    opacity: 0; transition: opacity .2s ease;
}
.wf-guide__scrim.is-open { opacity: 1; }

.wf-guide {
    position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 91;
    width: min(560px, 100vw);
    background: #fff;
    box-shadow: var(--wf-shadow-lg);
    transform: translateX(100%);
    transition: transform .22s ease;
    display: flex; flex-direction: column;
}
.wf-guide.is-open { transform: none; }
.wf-guide__inner { display: flex; flex-direction: column; min-height: 0; height: 100%; }

.wf-guide__head {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--wf-line);
}
.wf-guide__crumb { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--wf-muted); }
.wf-guide__title { margin: 2px 0 0; font-size: 1.12rem; line-height: 1.3; }
.wf-guide__x {
    margin-inline-start: auto; flex: 0 0 auto;
    width: 36px; height: 36px; border-radius: 9px;
    border: 1px solid var(--wf-line); background: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.wf-guide__x:hover { background: #F4F6FA; }

.wf-guide__langs { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--wf-line); }
.wf-guide__lang {
    font: inherit; font-size: .82rem; font-weight: 600;
    padding: 7px 14px; min-height: 36px; border-radius: 999px;
    border: 1px solid var(--wf-line); background: #fff; color: var(--wf-ink);
    cursor: pointer;
}
.wf-guide__lang.is-on { background: var(--wf-navy); border-color: var(--wf-navy); color: #fff; }

.wf-guide__body { padding: 16px 18px 40px; overflow-y: auto; overscroll-behavior: contain; }
.wf-guide__loading { padding: 24px 18px; color: var(--wf-muted); }
.wf-guide__sec { margin-bottom: 20px; }
.wf-guide__sec h3 {
    margin: 0 0 7px; font-size: .95rem; color: var(--wf-navy);
}
.wf-guide__sec p { margin: 0; line-height: 1.7; text-align: justify; }
.wf-guide__steps, .wf-guide__list { margin: 0; padding-inline-start: 20px; }
.wf-guide__steps li, .wf-guide__list li { margin-bottom: 8px; line-height: 1.65; text-align: justify; }
.wf-guide__sec--impact {
    background: #F4F8FF; border: 1px solid #DCE6F7; border-radius: 10px; padding: 14px 16px 6px;
}
.wf-guide__sec--note {
    background: #FFF8EC; border: 1px solid #F3E2C0; border-radius: 10px; padding: 14px 16px 6px;
}
.wf-guide__sec--note h3 { color: #9A6212; }

body.wf-noscroll { overflow: hidden; }

@media (max-width: 620px) {
    /* On a phone the guide comes up from the bottom, like a sheet. */
    .wf-guidebtn span { display: none; }
    .wf-guidebtn { padding: 7px 10px; }
    .wf-guide {
        inset-inline: 0; top: auto; height: 88vh; width: auto;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }
}

@media print {
    .wf-guidebtn, .wf-guide, .wf-guide__scrim { display: none !important; }
}
