:root {
  --green-950: #145331;
  --green-900: #19653E;
  --green-800: #245F40;
  --green-700: #2F6B49;
  --green-100: #E6F5EA;
  --orange: #B36B00;
  --orange-soft: #FFF4DF;
  --gold: #F2B33D;
  --gold-soft: #FFF6E2;
  --ink: #222222;
  --muted: #6B7891;
  --line: #E2E8F0;
  --surface: #ffffff;
  --canvas: #F3F5F7;
  --shadow: 0 18px 45px rgba(20, 83, 49, .08);
  --radius: 20px;
  /* Identidade www.eacacia.gov.mz */
  --green-600: #388A1C;
  --green-500: #46B022;
  --green-50: #F3FDF3;
  --font-titulo: "Poppins", "Segoe UI", Arial, sans-serif;
  --font-texto: "Inter", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: #2D2D2D; font-family: var(--font-texto); font-size: 16px; line-height: 1.5; }
h1, h2, h3, .balance-value, .modal h2 { font-family: var(--font-titulo); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column; background: var(--green-900); color: #fff; overflow-y: auto; }
.brand-panel { min-height: 158px; display: grid; place-items: center; padding: 14px 20px 8px; background: transparent; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-panel img { display: block; width: 190px; max-height: 128px; object-fit: contain; }
.side-nav { padding: 22px 14px; }
.nav-label { margin: 0 14px 9px; color: rgba(255,255,255,.48); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 26px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 0; border-radius: 12px; color: rgba(255,255,255,.74); background: transparent; text-align: left; transition: .18s ease; }
.nav-item + .nav-item { margin-top: 4px; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.14); box-shadow: inset 3px 0 0 var(--gold); }
.nav-item svg { width: 20px; height: 20px; }
.sidebar-foot { margin-top: auto; padding: 20px; border-top: 1px solid rgba(255,255,255,.08); }
.district-badge { display: flex; align-items: center; gap: 11px; }
.district-badge > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--orange); font-size: .78rem; font-weight: 800; }
.district-badge div { display: grid; }
.district-badge strong { font-size: .82rem; }
.district-badge small, .sidebar-foot > p { color: rgba(255,255,255,.55); font-size: .72rem; }
.sidebar-foot > p { margin: 14px 0 0; }
.sidebar-scrim { display: none; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 78px; display: flex; align-items: center; gap: 20px; padding: 0 30px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.menu-button { display: none !important; }
.global-search { width: min(420px, 42vw); display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f8; color: #7f8b86; }
.global-search input { width: 100%; height: 44px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.role-control { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.role-control span { color: var(--muted); font-size: .78rem; }
.role-control select { border: 0; outline: 0; color: var(--green-800); font-weight: 700; background: transparent; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.notification-button { position: relative; }
.notification-button span { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--orange); }
.profile-button { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; text-align: left; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green-700); font-size: .82rem; font-weight: 800; }
.profile-copy { display: grid; }
.profile-copy strong { font-size: .86rem; }
.profile-copy small { color: var(--muted); font-size: .72rem; }

.main-content { max-width: 1510px; margin: 0 auto; padding: 32px clamp(20px, 3vw, 44px) 54px; }
.role-view { display: none; }
.role-view.active { display: block; animation: fade-in .3s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin: 2px 0 4px; color: #222; font-size: clamp(1.7rem, 2.8vw, 2.2rem); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--green-700) !important; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #CBE9C0; border-radius: 999px; color: var(--green-700); background: #f3fcf7; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.status-pill > span { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 4px rgba(70,176,34,.14); }

.resident-hero, .merchant-summary { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); gap: 20px; }
.balance-card { position: relative; overflow: hidden; padding: 28px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, var(--green-800), var(--green-950)); box-shadow: var(--shadow); }
.balance-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -120px; border: 45px solid rgba(242,179,61,.14); border-radius: 50%; }
.balance-top { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.72); }
.balance-top button { display: grid; place-items: center; border: 0; color: inherit; background: transparent; }
.balance-value { position: relative; z-index: 1; display: block; margin: 8px 0 2px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -.03em; }
.balance-card > small { color: rgba(255,255,255,.75); }
.quick-actions { position: relative; z-index: 2; display: flex; gap: 28px; margin-top: 28px; }
.quick-action { display: grid; justify-items: center; gap: 7px; border: 0; color: #fff; background: transparent; font-size: .77rem; }
.quick-action span { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; color: var(--green-950); background: #fff; transition: .2s ease; }
.quick-action:hover span { transform: translateY(-3px); background: var(--gold); }
.digital-card { position: relative; overflow: hidden; min-height: 255px; padding: 26px 28px; border-radius: 24px; color: #fff; background: linear-gradient(145deg, #0F3B24 0%, #19653E 58%, #2F6B49 100%); box-shadow: 0 22px 50px rgba(12,25,20,.2); }
.digital-card::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 80% 10%, rgba(242,179,61,.32), transparent 32%), linear-gradient(125deg, transparent 46%, rgba(255,255,255,.04) 47%, transparent 49%); }
.card-glow { position: absolute; width: 190px; height: 190px; right: -70px; bottom: -85px; border-radius: 50%; background: var(--orange); filter: blur(20px); opacity: .28; }
.digital-card-head, .digital-card-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.digital-card-head > span:first-child { color: var(--gold); font-weight: 800; letter-spacing: .08em; }
.digital-card-head b { color: #fff; }
.card-chip { width: 42px; height: 31px; border-radius: 8px; background: linear-gradient(135deg,#ffe58b,#b98519); }
.digital-card-number { position: relative; z-index: 1; margin: 58px 0 24px; font-family: Consolas, monospace; font-size: 1.28rem; letter-spacing: .14em; }
.digital-card-foot { justify-content: flex-start; gap: 46px; }
.digital-card-foot div { display: grid; }
.digital-card-foot small { color: rgba(255,255,255,.5); font-size: .6rem; letter-spacing: .1em; }
.digital-card-foot strong { font-size: .75rem; letter-spacing: .04em; }
.digital-card-foot .contactless { margin-left: auto; transform: rotate(90deg); font-weight: 700; letter-spacing: -3px; }

.stats-grid, .admin-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.stat-card, .admin-kpis article { display: flex; align-items: center; gap: 14px; min-height: 116px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 25px rgba(20,83,49,.035); }
.stat-icon { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; }
.stat-icon.green { color: var(--green-700); background: var(--green-100); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-icon.gold { color: #9c7100; background: var(--gold-soft); }
.stat-icon.blue { color: #2375b7; background: #e8f4ff; }
.stat-card div, .admin-kpis article > div { display: grid; }
.stat-card small, .admin-kpis small { color: var(--muted); }
.stat-card strong, .admin-kpis strong { font-size: 1.26rem; }
.stat-card em, .admin-kpis em { color: var(--green-700); font-size: .72rem; font-style: normal; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr); gap: 20px; margin-top: 20px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 4px rgba(0,0,0,.05); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; color: #222; font-size: 1.08rem; font-weight: 600; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.text-button { display: flex; align-items: center; gap: 5px; border: 0; color: var(--green-700); background: transparent; font-size: .78rem; font-weight: 700; }
.text-button svg { width: 16px; }
.transaction-row { display: grid; grid-template-columns: auto minmax(140px,1fr) auto minmax(110px,auto); align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #edf1ef; }
.transaction-row:first-child { border-top: 0; }
.merchant-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; font-size: .72rem; font-weight: 800; }
.merchant-avatar.market { color: var(--green-700); background: var(--green-100); }
.merchant-avatar.pharmacy { color: #b13f43; background: #ffe8e8; }
.merchant-avatar.mobile { color: #a07806; background: var(--gold-soft); }
.merchant-avatar.transport { color: #346fa1; background: #e8f3fd; }
.merchant-avatar.agro { color: #5d7d24; background: #eef8dc; }
.transaction-name, .transaction-amount { display: grid; }
.transaction-name strong { font-size: .86rem; }
.transaction-name small, .transaction-amount small { color: var(--muted); font-size: .7rem; }
.discount-tag { padding: 4px 8px; border-radius: 8px; color: var(--orange); background: var(--orange-soft); font-size: .7rem; font-weight: 800; }
.status-mini { padding: 4px 8px; border-radius: 8px; color: var(--green-700); background: var(--green-100); font-size: .68rem; font-weight: 700; }
.status-mini.pending { color: #8a6507; background: var(--gold-soft); }
.transaction-amount { text-align: right; }
.transaction-amount strong { font-size: .83rem; }
.transaction-amount.positive strong { color: var(--green-700); }
.optional-row { display: none; }
.optional-row.visible { display: grid; }
.offer-list { display: grid; gap: 6px; }
.offer-item { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 11px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.offer-item:hover { background: #f4f8f6; }
.offer-item > span:nth-child(2) { display: grid; }
.offer-item strong { font-size: .82rem; }
.offer-item small { color: var(--muted); font-size: .7rem; }
.offer-item b { color: var(--orange); }
.offer-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; }
.offer-icon.health { color: #b13f43; background: #ffe8e8; }
.offer-icon.agro { color: #5d7d24; background: #eef8dc; }
.offer-icon.school { color: #346fa1; background: #e8f3fd; }
.outline-button, .primary-button, .ghost-button { min-height: 44px; padding: 0 18px; border-radius: 8px; font-weight: 600; }
.outline-button { border: 1px solid var(--green-600); color: var(--green-700); background: #fff; }
.outline-button:hover { border-color: var(--green-700); background: var(--green-50); }
.primary-button { border: 1px solid var(--green-700); color: #fff; background: var(--green-700); }
.primary-button:hover { border-color: var(--green-900); background: var(--green-900); }
.primary-button.light { border-color: #fff; color: var(--green-900); background: #fff; }
.ghost-button { border: 1px solid rgba(255,255,255,.28); color: #fff; background: transparent; }
.full-width { width: 100%; margin-top: 16px; }
.small { min-height: 36px; font-size: .76rem; }

.merchant-wallet { display: flex; flex-direction: column; justify-content: center; padding: 30px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, var(--green-800), var(--green-950)); }
.merchant-wallet p { margin: 0; color: rgba(255,255,255,.72); }
.merchant-wallet h2 { margin: 5px 0 0; font-size: clamp(2rem,4vw,3rem); }
.merchant-wallet small { color: rgba(255,255,255,.58); }
.merchant-wallet > div { display: flex; gap: 10px; margin-top: 26px; }
.settlement-card { padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: #fff; }
.date-chip, .count-badge { padding: 5px 9px; border-radius: 9px; color: var(--muted); background: #f1f5f3; font-size: .7rem; font-weight: 700; }
.settlement-card dl { margin: 0; }
.settlement-card dl div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; color: var(--muted); font-size: .8rem; }
.settlement-card dd { margin: 0; color: var(--ink); font-weight: 700; }
.settlement-card .settlement-total { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-size: .92rem; font-weight: 700; }
.live-label { display: flex; align-items: center; gap: 6px; color: var(--green-700); font-size: .7rem; font-weight: 700; }
.live-label i { width: 7px; height: 7px; border-radius: 50%; background: #24a76d; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(36,167,109,0); } 0% { box-shadow: 0 0 0 0 rgba(36,167,109,.3); } }
.bar-chart { height: 250px; display: flex; align-items: flex-end; justify-content: space-between; gap: 9px; padding-top: 34px; }
.bar-chart > div { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar-chart i { width: min(25px, 70%); height: var(--h); border-radius: 7px 7px 2px 2px; background: linear-gradient(to top,var(--green-700),#47a57e); }
.bar-chart span { color: var(--muted); font-size: .62rem; opacity: 0; transition: .2s; }
.bar-chart div:hover span { opacity: 1; }
.bar-chart small { color: var(--muted); font-size: .66rem; }

.admin-kpis { grid-template-columns: repeat(4, minmax(0,1fr)); }
.admin-kpis article { justify-content: space-between; }
.admin-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.65fr); gap: 20px; }
.panel-head select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; }
.volume-chart { height: 280px; display: grid; grid-template-columns: 35px 1fr; gap: 8px; }
.y-labels { display: flex; flex-direction: column; justify-content: space-between; padding: 1px 0 25px; color: var(--muted); font-size: .65rem; }
.line-chart { display: grid; grid-template-rows: 1fr auto; min-width: 0; background-image: linear-gradient(to bottom, transparent calc(20% - 1px), #edf1ef 20%, transparent calc(20% + 1px)); background-size: 100% 20%; }
.line-chart svg { width: 100%; height: 100%; overflow: visible; stroke-width: 3; }
.chart-area { fill: url(#chartFill); stroke: none; }
.chart-line { fill: none; stroke: var(--green-700); }
.line-chart circle { fill: #fff; stroke: var(--green-700); }
.x-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .67rem; }
.donut-wrap { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 18px; min-height: 250px; }
.donut { width: 140px; height: 140px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green-700) 0 38%, var(--orange) 38% 62%, var(--gold) 62% 80%, #397ead 80% 92%, #c6d1cc 92%); }
.donut::before { content: ""; width: 82px; height: 82px; grid-area: 1/1; border-radius: 50%; background: #fff; }
.donut div { z-index: 1; grid-area: 1/1; display: grid; text-align: center; }
.donut small { color: var(--muted); font-size: .65rem; }
.donut-wrap ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.donut-wrap li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; }
.donut-wrap li div { width: 100%; display: flex; justify-content: space-between; }
.donut-wrap li b { color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.food { background: var(--green-700); }.dot.health { background: var(--orange); }.dot.transport { background: var(--gold); }.dot.education { background: #397ead; }.dot.other { background: #c6d1cc; }
.approval-list > div, .service-list > div { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #edf1ef; }
.approval-list > div:first-child, .service-list > div:first-child { border-top: 0; }
.approval-list p, .service-list p { flex: 1; display: grid; margin: 0; }
.approval-list strong, .service-list strong { font-size: .82rem; }
.approval-list small, .service-list small { color: var(--muted); font-size: .7rem; }
.service-status { width: 9px; height: 9px; border-radius: 50%; }.service-status.up { background: #24a76d; box-shadow: 0 0 0 4px rgba(36,167,109,.12); }
.provider { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; font-size: .8rem; font-weight: 900; }
.provider.mpesa { background: #e32f35; }.provider.emola { background: #ef781b; }.provider.mkesh { background: #2687c7; }

.search-results { animation: fade-in .3s ease both; }
.company-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.company-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.company-card > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.company-card h3 { margin: 14px 0 3px; }.company-card p { margin: 0 0 14px; color: var(--muted); font-size: .8rem; }
.company-card .discount-large { color: var(--orange); font-size: 1.5rem; font-weight: 800; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(3,23,16,.64); backdrop-filter: blur(4px); }
.modal { position: fixed; top: 50%; left: 50%; z-index: 90; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 30px; border-radius: 24px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.25); transform: translate(-50%,-50%); }
.modal[hidden], .modal-backdrop[hidden] { display: none; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.modal-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 15px; color: var(--green-700); background: var(--green-100); }
.modal h2 { margin: 2px 0 4px; font-size: 1.55rem; }.modal > p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); }
.field-label, fieldset legend { display: block; margin: 15px 0 7px; color: #4B5563; font-size: .82rem; font-weight: 500; }
.money-input { height: 54px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.money-input:focus-within { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(47,107,73,.1); }
.money-input input { width: 100%; height: 100%; padding: 0 14px; border: 0; outline: 0; font-size: 1.15rem; font-weight: 700; }
.money-input span { padding: 0 16px; color: var(--muted); font-weight: 700; }
.amount-chips { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-top: 8px; }
.amount-chips button { padding: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: .74rem; }
.amount-chips button.active { border-color: var(--green-700); color: var(--green-700); background: var(--green-100); }
fieldset { margin: 0; padding: 0; border: 0; }
.provider-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.provider-options label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; font-size: .74rem; }
.provider-options label:has(input:checked) { border-color: var(--green-700); background: #f4fbf7; box-shadow: inset 0 0 0 1px var(--green-700); }
.provider-options input { position: absolute; opacity: 0; }
.fee-box { margin-top: 16px; padding: 14px; border-radius: 13px; background: #f5f8f6; }
.fee-box > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--muted); font-size: .78rem; }
.fee-box strong { color: var(--ink); }
.fee-box .fee-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink); font-size: .88rem; font-weight: 700; }
.text-input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #D1D5DB; border-radius: 8px; outline: 0; color: #334155; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.text-input:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(56,138,28,.15); }
.discount-preview, .notice-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--gold-soft); }
.discount-preview { display: grid; gap: 6px; color: #6f5713; font-size: .8rem; }.discount-preview strong { color: var(--ink); }.discount-preview em { color: var(--green-700); font-style: normal; }
.notice-box { color: var(--muted); background: #f3f6f4; font-size: .77rem; }
.card-modal { text-align: center; }.card-modal .modal-close { position: absolute; }.card-modal .status-pill { margin-top: 10px; }
.qr-demo { position: relative; width: 190px; height: 190px; margin: 24px auto 16px; border: 14px solid #fff; outline: 1px solid var(--line); background: repeating-conic-gradient(#10231c 0 25%,#fff 0 50%) 0/22px 22px; }
.qr-demo span { position: absolute; width: 50px; height: 50px; border: 9px solid #10231c; background: #fff; }.qr-demo span:nth-child(1){left:5px;top:5px}.qr-demo span:nth-child(2){right:5px;top:5px}.qr-demo span:nth-child(3){left:5px;bottom:5px}.qr-demo i{position:absolute;width:36px;height:36px;right:18px;bottom:22px;background:var(--orange)}
.percent-input { width: 160px; }
.toast { position: fixed; right: 26px; bottom: 26px; z-index: 120; min-width: 310px; display: flex; align-items: center; gap: 12px; padding: 14px 17px; border: 1px solid #CBE9C0; border-radius: 14px; background: #fff; box-shadow: var(--shadow); transform: translateY(130%); opacity: 0; transition: .3s ease; }
.toast.show { transform: translateY(0); opacity: 1; }.toast > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green-700); }.toast p { display: grid; margin: 0; }.toast strong { font-size: .82rem; }.toast small { color: var(--muted); font-size: .72rem; }

@media (max-width: 1120px) {
  .profile-copy { display: none; }
  .admin-kpis { grid-template-columns: repeat(2,1fr); }
  .resident-hero, .merchant-summary { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 270px; transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(2,22,15,.5); }.sidebar-scrim.show { display: block; }
  .menu-button { display: grid !important; }
  .topbar { padding: 0 18px; }
  .global-search { width: min(360px, 48vw); }
  .role-control span { display: none; }
  .resident-hero, .merchant-summary, .content-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .company-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar { height: 68px; gap: 9px; }
  .global-search { flex: 1; width: auto; }
  .topbar-actions { margin-left: 0; }
  .notification-button, .profile-button { display: none; }
  .role-control { max-width: 116px; }.role-control select { width: 100%; }
  .main-content { padding: 24px 15px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .resident-hero { display: flex; flex-direction: column; }.digital-card { order: -1; min-height: 230px; }
  .stats-grid, .admin-kpis, .company-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 96px; }
  .panel { padding: 18px; }
  .transaction-row { grid-template-columns: auto 1fr auto; }.transaction-row > .discount-tag,.transaction-row > .status-mini { display: none; }.transaction-amount { grid-column: 2 / 4; margin-top: -8px; }
  .quick-actions { justify-content: space-between; gap: 10px; }
  .digital-card-foot { gap: 22px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .provider-options { grid-template-columns: 1fr 1fr 1fr; }
  .modal { padding: 26px 20px; }
  .toast { right: 14px; left: 14px; bottom: 14px; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* =====================================================================
   Portal dinâmico (PHP) — acrescentos ao design do protótipo
   ===================================================================== */
a { color: var(--green-700); }
.nav-item { text-decoration: none; }
.nav-item span { flex: 1; }
.nav-count { min-width: 20px; padding: 1px 7px; border-radius: 999px; color: var(--green-950); background: var(--gold); font-size: .68rem; font-style: normal; font-weight: 800; text-align: center; }
.sidebar-role { display: none; padding: 0 0 6px; }
.sidebar-role .nav-label { display: block; }
.sidebar-role select { width: 100%; padding: 10px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; color: #fff; background: rgba(255,255,255,.06); font-weight: 700; }
.sidebar-role option { color: var(--ink); }
.brand-panel a { display: block; }
.as-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:disabled, .quick-action:disabled { cursor: not-allowed; opacity: .5; }
.quick-action { text-decoration: none; }
.quick-action:disabled:hover span { transform: none; background: #fff; }
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: .02em; }
.empty-state { margin: 0; padding: 22px 6px; color: var(--muted); font-size: .84rem; text-align: center; }
.text-muted { color: var(--muted); }
.valor-positivo { color: var(--green-700); font-weight: 700; }
.valor-negativo { color: #b13f43; font-weight: 700; }

/* Estados (plano, secção 5) */
.status-mini { white-space: nowrap; }
.status-mini.falhado, .status-mini.recusado { color: #a23237; background: #ffe8e8; }
.status-mini.expirado, .status-mini.neutro { color: #5f6b66; background: #edf1ef; }
.status-mini.estornado { color: #346fa1; background: #e8f3fd; }
.status-pill.aviso { border-color: #f2d58b; color: #8a6507; background: var(--gold-soft); }
.status-pill.aviso > span { background: #e0a31a; box-shadow: 0 0 0 4px rgba(224,163,26,.15); }
.status-pill.erro { border-color: #f3c0c2; color: #a23237; background: #fff3f3; }
.status-pill.erro > span { background: #d8464c; box-shadow: 0 0 0 4px rgba(216,70,76,.14); }
.heading-status { display: grid; justify-items: end; gap: 6px; }
.heading-status small { color: var(--muted); font-size: .74rem; }

/* Toast de erro/aviso */
.toast.erro { border-color: #f3c0c2; }
.toast.erro > span { background: #d8464c; }
.toast.aviso { border-color: #f2d58b; }
.toast.aviso > span { background: #e0a31a; }

/* Alertas (flash) */
.alert { margin: 0 0 18px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; font-size: .84rem; line-height: 1.45; }
.alert-sucesso { border-color: #CBE9C0; color: #0b5a3e; background: #f3fcf7; }
.alert-erro { border-color: #f3c0c2; color: #8f2a2f; background: #fff3f3; }
.alert-aviso { border-color: #f2d58b; color: #6f5713; background: var(--gold-soft); }
.alert-info { border-color: #cfe3f5; color: #28577f; background: #f1f8ff; }
.form-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; color: #8f2a2f; background: #fff3f3; font-size: .78rem; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: .72rem; }

/* Carregar: operador "Brevemente" e passos */
.provider-options label.desactivado { cursor: not-allowed; opacity: .55; background: #f7f9f8; }
.provider-options label.desactivado .provider { filter: grayscale(.7); }
.brevemente { position: absolute; top: -8px; right: -4px; padding: 2px 6px; border-radius: 7px; color: #6f5713; background: var(--gold-soft); border: 1px solid #f2d58b; font-size: .58rem; font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.modal-icon.erro { color: #a23237; background: #ffe8e8; }
.modal-icon.aviso { color: #8a6507; background: var(--gold-soft); }
.pulse-icon { animation: pulse-ring 1.6s infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(47,107,73,.35); } 70% { box-shadow: 0 0 0 14px rgba(47,107,73,0); } 100% { box-shadow: 0 0 0 0 rgba(47,107,73,0); } }
.steps-progress { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; padding: 12px 14px; border-radius: 12px; color: var(--green-800); background: #f3fbf7; font-size: .8rem; font-weight: 600; }
.spinner { flex: 0 0 auto; width: 18px; height: 18px; border: 3px solid rgba(47,107,73,.2); border-top-color: var(--green-700); border-radius: 50%; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.mini-dl { display: grid; gap: 2px; margin: 12px 0; }
.mini-dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid #edf1ef; font-size: .8rem; }
.mini-dl dt { color: var(--muted); }
.mini-dl dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions > * { flex: 1; }
.input-with-button { display: flex; gap: 8px; }
.input-with-button .text-input { flex: 1; min-width: 0; }
.input-with-button .outline-button { display: inline-flex; align-items: center; gap: 6px; min-height: 50px; white-space: nowrap; }
.qr-reader { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.pin-input { letter-spacing: .4em; font-size: 1.1rem; font-weight: 700; }
.code-input { letter-spacing: .5em; font-size: 1.35rem; font-weight: 800; text-align: center; font-family: Consolas, monospace; }
/* Código com prefixo fixo (ex.: C-267891): o prefixo aparece antes da caixa e não se escreve */
.code-prefixo { display: flex; align-items: stretch; }
.code-prefixo > span { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: #f1f5f2; color: #19653E; font: 800 1.35rem Consolas, monospace; user-select: none; }
.code-prefixo > span + .code-input { flex: 1; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; text-align: left; }
.a-carregar { opacity: .75; }
.discount-preview small { color: #6f5713; font-size: .74rem; }
.discount-big { font-size: 1.9rem !important; line-height: 1.1; color: var(--orange) !important; }

/* Empresa ("Ver condições") */
.empresa-detalhe-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-right: 40px; }
.empresa-detalhe-head h2 { margin: 0; }
.empresa-detalhe-head .eyebrow { margin: 0; }
.empresa-descricao { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }
.campaign-list { display: grid; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.campaign-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.campaign-list b { min-width: 54px; color: var(--orange); font-size: 1.1rem; }
.campaign-list span { display: grid; }
.campaign-list small { color: var(--muted); font-size: .72rem; }
.merchant-avatar.school, .offer-icon.school { color: #346fa1; background: #e8f3fd; }
.merchant-avatar.health, .offer-icon.health { color: #b13f43; background: #ffe8e8; }
.offer-icon.market { color: var(--green-700); background: var(--green-100); }
.offer-icon.pharmacy { color: #b13f43; background: #ffe8e8; }
.offer-icon.mobile { color: #a07806; background: var(--gold-soft); }
.offer-icon.transport { color: #346fa1; background: #e8f3fd; }
.company-card .discount-large small { font-size: .62rem; font-weight: 700; }
.company-card .campaign-flag { display: inline-block; margin-bottom: 10px; padding: 3px 8px; border-radius: 8px; color: var(--orange); background: var(--orange-soft); font-size: .66rem; font-weight: 800; }

/* Topbar: sino, pesquisa e menu de perfil */
.dropdown-wrap { position: relative; }
.notification-button .notif-count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--orange); font-size: .62rem; font-weight: 800; line-height: 1; }
.notification-button .notif-count[hidden] { display: none; }
.notif-panel, .profile-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: min(360px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 24px 60px rgba(20,83,49,.18); overflow: hidden; }
.notif-panel[hidden], .profile-menu[hidden], .search-suggestions[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid #f0f3f1; color: var(--ink); text-decoration: none; font-size: .78rem; }
.notif-item:hover { background: #f7faf8; }
.notif-item span { color: var(--muted); }
.notif-item small { color: #8b9792; font-size: .68rem; }
.notif-item.nao-lida { background: #f4fbf7; box-shadow: inset 3px 0 0 var(--green-700); }
.notif-empty { margin: 0; padding: 18px 16px; color: var(--muted); font-size: .8rem; text-align: center; }
.notif-foot { display: block; padding: 12px 16px; color: var(--green-700); font-size: .78rem; font-weight: 700; text-align: center; text-decoration: none; }
.profile-menu { width: 240px; padding: 6px; }
.profile-menu-head { display: grid; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profile-menu-head strong { font-size: .84rem; }
.profile-menu-head small { color: var(--muted); font-size: .72rem; }
.profile-menu a, .profile-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font-size: .82rem; text-align: left; text-decoration: none; }
.profile-menu a:hover, .profile-menu button:hover { background: #f4f8f6; }
.profile-menu svg { width: 18px; height: 18px; color: var(--muted); }
.profile-menu form { margin: 0; }
.global-search { position: relative; }
.search-suggestions { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60; min-width: 280px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 24px 60px rgba(20,83,49,.16); }
.suggestion { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; }
.suggestion:hover { background: #f4f8f6; }
.suggestion .merchant-avatar { width: 34px; height: 34px; border-radius: 10px; }
.suggestion span:nth-child(2) { display: grid; }
.suggestion strong { font-size: .8rem; }
.suggestion small { color: var(--muted); font-size: .68rem; }
.suggestion b { color: var(--orange); font-size: .8rem; }
.suggestion-all { width: 100%; margin-top: 4px; padding: 9px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--green-700); font-size: .76rem; font-weight: 700; }

/* Páginas: filtros, tabelas, formulários e paginação */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.toolbar .campo { display: grid; gap: 5px; }
.toolbar label { color: var(--muted); font-size: .7rem; font-weight: 700; }
.toolbar .text-input, .toolbar select { min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: .82rem; }
.toolbar .campo-largo { flex: 1; min-width: 180px; }
.toolbar .outline-button, .toolbar .primary-button { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: .8rem; }
.tabs-nav { display: flex; gap: 6px; margin-bottom: 16px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #fff; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs-nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-size: .8rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tabs-nav a.active { color: var(--green-800); background: var(--green-100); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.data-table th { padding: 11px 10px; border-bottom: 1px solid var(--line); color: var(--green-950); background: #E6F5EA; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 12px 10px; border-bottom: 1px solid #edf1ef; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table td small { display: block; color: var(--muted); font-size: .7rem; }
.data-table tfoot td { border-top: 2px solid var(--line); font-weight: 800; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pagination .outline-button { display: inline-flex; align-items: center; text-decoration: none; }
.pagination-info { margin: 12px 0 0; margin-right: auto; color: var(--muted); font-size: .76rem; }
.pagination .pagination-info { margin: 0 auto 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.text-area { width: 100%; min-height: 120px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; outline: 0; font: inherit; resize: vertical; }
.text-area:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(47,107,73,.1); }
select.text-input { appearance: auto; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.form-actions .primary-button, .form-actions .outline-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.page-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.panel + .panel { margin-top: 0; }
.stack { display: grid; gap: 20px; }
.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 10px 18px; margin: 0; font-size: .84rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.info-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.info-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; }
.info-list li span { display: grid; }
.info-list small { color: var(--muted); font-size: .72rem; }
.pill-count { display: inline-block; min-width: 22px; padding: 2px 8px; border-radius: 999px; color: var(--green-950); background: var(--gold); font-size: .7rem; font-weight: 800; text-align: center; }
.section-title { margin: 28px 0 12px; font-size: 1.02rem; }

/* Cartão virtual e QR */
.card-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.qr-box { width: 220px; max-width: 100%; margin: 6px auto 14px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.qr-box svg, .qr-box img { display: block; width: 100%; height: auto; }
.card-numero { display: block; margin-top: 4px; font-family: Consolas, monospace; font-size: 1.1rem; letter-spacing: .06em; text-align: center; }
.card-center { text-align: center; }
.card-center .status-pill { margin-top: 10px; }

/* Cobranças */
.cobranca-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.cobranca-card + .cobranca-card { margin-top: 12px; }
.cobranca-card .cobranca-info { display: grid; gap: 2px; }
.cobranca-card .cobranca-info small { color: var(--muted); font-size: .74rem; }
.cobranca-card .cobranca-accoes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cobranca-valor { font-size: 1.2rem; font-weight: 800; }
.cobranca-painel .status-pill { font-size: .8rem; }
.contador-tempo { color: var(--muted); font-size: .78rem; font-weight: 700; }

/* Reclamações */
.thread { display: grid; gap: 10px; margin: 14px 0; }
.thread-msg { max-width: 88%; padding: 12px 14px; border-radius: 14px; background: #F3F5F7; font-size: .82rem; }
.thread-msg.admin { justify-self: start; background: var(--green-100); }
.thread-msg.proprio { justify-self: end; background: #fff; border: 1px solid var(--line); }
.thread-msg small { display: block; margin-bottom: 4px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.thread-msg p { margin: 0; white-space: pre-wrap; }

/* Empresa: saldos */
.saldo-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.saldo-mini div { display: grid; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.08); }
.saldo-mini small { color: rgba(255,255,255,.6); font-size: .66rem; }
.saldo-mini strong { font-size: .92rem; }
.merchant-wallet .ghost-button { display: inline-flex; align-items: center; text-decoration: none; }
.merchant-wallet > div { flex-wrap: wrap; }
.bar-chart span { opacity: 1; }
.operador-cta { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 30px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, var(--green-800), var(--green-950)); }
.operador-cta h2 { margin: 0; font-size: 1.6rem; }
.operador-cta p { margin: 0; color: rgba(255,255,255,.72); }
.operador-cta .primary-button { align-self: flex-start; display: inline-flex; align-items: center; text-decoration: none; }

/* Cartaz do QR da empresa */
.cartaz-qr { max-width: 520px; margin: 0 auto; padding: 34px 30px; border: 2px solid var(--green-900); border-radius: 26px; background: #fff; text-align: center; }
.cartaz-qr img.cartaz-logo { width: 150px; height: auto; margin: 0 auto 8px; display: block; }
.cartaz-qr h2 { margin: 4px 0; font-size: 1.7rem; }
.cartaz-qr .qr-box { width: 280px; border: 0; }
.cartaz-qr .cartaz-codigo { display: inline-block; margin: 6px 0 14px; padding: 8px 16px; border-radius: 12px; background: var(--green-100); color: var(--green-900); font-family: Consolas, monospace; font-size: 1.2rem; font-weight: 800; letter-spacing: .06em; }
.cartaz-qr .cartaz-desconto { color: var(--orange); font-size: 2.2rem; font-weight: 900; line-height: 1.1; }
.cartaz-qr ol { margin: 16px auto 0; padding-left: 20px; max-width: 360px; color: var(--muted); font-size: .86rem; text-align: left; }

/* Página de entrada */
.login-page { min-height: 100vh; background: linear-gradient(90deg, #F5F5F5 0%, #F5F5F5 50%, #fff 50%); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); align-items: center; gap: 40px; max-width: 1080px; margin: 0 auto; padding: 32px 20px; }
.login-brand { color: #2D2D2D; }
.login-brand img { display: block; width: 260px; max-width: 70%; height: auto; margin-bottom: 20px; }
.login-brand p { max-width: 420px; margin: 0 0 12px; color: #2D2D2D; font-size: 1.15rem; line-height: 1.5; }
.login-brand small { color: var(--muted); font-size: .78rem; }
.login-card { padding: 34px 30px; border: 1px solid #E2E8F0; border-radius: 20px; background: #fff; box-shadow: 0 12px 40px rgba(20,83,49,.10); }
.login-card h1 { margin: 2px 0 6px; color: #222; font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.login-intro { margin: 0 0 16px; color: var(--muted); font-size: .88rem; }
.login-card .alert { margin: 12px 0 4px; }
.login-links, .login-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: .82rem; }
.login-links a { color: var(--green-700); font-weight: 600; text-decoration: none; }
.login-actions form { margin: 0; }
.login-foot { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

@media (max-width: 1120px) {
  .page-grid, .card-page { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar-role { display: block; }
  .topbar-actions .role-control { display: none; }
  .login-shell { grid-template-columns: 1fr; gap: 24px; }
  .login-brand { text-align: center; }
  .login-brand img { margin: 0 auto 14px; width: 200px; }
  .login-brand p { margin: 0 auto 8px; font-size: 1rem; }
}
@media (max-width: 640px) {
  .portal-body .notification-button { display: grid; }
  .portal-body .profile-button { display: flex; }
  .portal-body .profile-copy { display: none; }
  .portal-body .topbar-actions { gap: 8px; }
  .heading-status { justify-items: start; }
  .form-grid { grid-template-columns: 1fr; }
  .saldo-mini { grid-template-columns: 1fr; }
  .cobranca-card { grid-template-columns: 1fr; }
  .cobranca-card .cobranca-accoes { justify-content: stretch; }
  .cobranca-card .cobranca-accoes > * { flex: 1; }
  .data-table { font-size: .76rem; }
  .data-table th, .data-table td { padding: 10px 7px; }
  .toolbar .campo, .toolbar .campo-largo { flex: 1 1 140px; }
  .login-card { padding: 26px 20px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .input-with-button .outline-button span { display: none; }
  .search-suggestions { position: fixed; top: 70px; left: 12px; right: 12px; min-width: 0; }
}

/* Impressão (cartaz do QR) */
@media print {
  body.imprimir-cartaz { background: #fff; }
  body.imprimir-cartaz .sidebar, body.imprimir-cartaz .topbar, body.imprimir-cartaz .no-print, body.imprimir-cartaz .alert, body.imprimir-cartaz .toast { display: none !important; }
  body.imprimir-cartaz .app-shell { display: block; }
  body.imprimir-cartaz .main-content { padding: 0; max-width: none; }
  body.imprimir-cartaz .cartaz-qr { border-width: 3px; max-width: 16cm; margin: 1cm auto; box-shadow: none; }
  body.imprimir-cartaz .page-heading { display: none; }
}

/* Portal — complementos */
.readonly-box { display: flex; align-items: center; background: #f7f9f8; color: var(--ink); font-size: .86rem; font-weight: 600; }
.faq-lista { display: grid; gap: 8px; }
.faq-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.faq-item summary { cursor: pointer; font-size: .84rem; font-weight: 700; }
.faq-item p { margin: 10px 0 0; color: var(--muted); font-size: .8rem; }
.passos-lista { display: grid; gap: 8px; margin: 0; padding-left: 20px; color: var(--muted); font-size: .82rem; }
.notif-pagina { max-height: none; margin: -8px -8px 0; }
.canal-options { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 320px; }
.provider.canal-wa { background: #25a35a; }
.info-list li .outline-button.small { margin-left: auto; }
.info-list li > span:first-child:not(.provider):not(.stat-icon) { flex: 1; }

@media (max-width: 640px) {
  .digital-card-number { margin: 44px 0 20px; font-size: 1.02rem; letter-spacing: .08em; white-space: nowrap; }
  .quick-actions .quick-action { flex: 1; }
}

/* Grelhas: as colunas nunca crescem para lá do ecrã por causa das tabelas */
.panel, .stack > * { min-width: 0; }
@media (max-width: 1120px) {
  .page-grid, .card-page { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .resident-hero, .merchant-summary, .content-grid { grid-template-columns: minmax(0, 1fr); }
}

.login-brand > a { display: inline-block; padding: 14px 24px 8px; border-radius: 22px; background: transparent; box-shadow: none; margin-bottom: 18px; }
.login-brand > a img { margin: 0; width: 220px; max-width: 100%; }
@media (max-width: 900px) { .login-brand > a img { width: 170px; } }

/* Cartão de benefícios e.acácia (exclusivo da plataforma — sem chip nem contactless) */
.card-selo { position: relative; z-index: 1; padding: 4px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #f4d27a; }
.digital-card-number { letter-spacing: .06em; font-size: 1.18rem; }
.digital-card-number small { display: block; margin-bottom: 4px; font-family: var(--font-texto); font-size: .62rem; letter-spacing: .12em; opacity: .7; }
.digital-card-foot .card-qr { margin-left: auto; width: 34px; height: 34px; padding: 4px; border-radius: 8px; background: #fff; color: #19653E; }
.digital-card-foot .card-qr svg { display: block; width: 100%; height: 100%; fill: currentColor; }
@media (max-width: 480px) { .digital-card-number { font-size: .98rem; letter-spacing: .03em; } }
/* e.acácia — registo */
.registo-form small { font-weight: 400; color: var(--muted, #6B7891); }
.consent-check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 6px; font-size: 13px; line-height: 1.45; color: var(--muted, #6B7891); }
.consent-check input { margin-top: 3px; }


/* e.acácia — tributos */
.tributos-lista { display: grid; gap: 10px; }
.tributo-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line, #E2E8F0); border-radius: 14px; background: #fff; }
.tributo-item.vencido { border-color: #f2c7a8; background: #fffaf3; }
.tributo-sigla { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--green-100, #E6F5EA); color: var(--green-900, #19653E); font-weight: 800; font-size: 14px; }
.tributo-info { display: grid; gap: 3px; min-width: 0; }
.tributo-info small { color: var(--muted, #6B7891); }
.tributo-valor { display: grid; gap: 6px; justify-items: end; text-align: right; }
.tributo-valor strong { font-size: 17px; }
.primary-button.small { padding: 8px 16px; font-size: 14px; }
.tributos-ligar .inline-form { margin-top: 10px; max-width: 520px; }
.info-list.compact li { padding-block: 8px; }
@media (max-width: 640px) { .tributo-item { grid-template-columns: 44px minmax(0, 1fr); } .tributo-sigla { width: 44px; height: 44px; } .tributo-valor { grid-column: 1 / -1; justify-items: stretch; text-align: left; grid-template-columns: 1fr auto; align-items: center; } }

.qr-contador { display: block; margin-top: 6px; color: var(--muted, #6B7891); font-size: 13px; font-variant-numeric: tabular-nums; }

.tributos-faixa { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 14px 18px; border-radius: 16px; background: #fff7ec; border: 1px solid #f3d9b1; color: inherit; text-decoration: none; }
.tributos-faixa.em-dia { background: var(--green-50, #F1F7F3); border-color: var(--green-100, #E6F5EA); }
.tributos-faixa:hover { box-shadow: 0 6px 18px rgba(31, 74, 53, .08); }
.tributos-faixa-texto { display: grid; gap: 2px; flex: 1; min-width: 0; }
.tributos-faixa-texto small { color: var(--muted, #6B7891); }
@media (max-width: 640px) { .tributos-faixa { flex-wrap: wrap; } .tributos-faixa .text-button { margin-left: auto; } }

@media (max-width: 900px) { .login-page { background: #F5F5F5; } }
