/* ===== BRISS + Purok Link — Barangay portal ===== */
:root {
    --ruby: #9B111E;
    --ruby-dark: #6E0C15;
    --gold: #C9A227;
}

html, body { font-family: Roboto, "Segoe UI", Arial, sans-serif; }
h1:focus { outline: none; }

.text-right { text-align: right; }
.app-footer { text-align: center; font-size: .75rem; color: #8a8a8a; padding: 12px 0 20px; }
.muted { color: #777; font-size: .82rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "Courier New", monospace; }

/* Brand mark in the app bar */
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--gold); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; margin-right: 10px; flex-shrink: 0; }

/* Cards */
.stat-card { background: #fff; border-radius: 10px; height: 100%; }
.panel { background: #fff; border-radius: 12px; height: 100%; }
.phase-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.phase-badge { background: var(--ruby); color: #fff; border-radius: 6px; padding: 2px 8px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; }
.phase-badge.gold { background: var(--gold); }
.phase-badge.blue { background: #0277BD; }

/* Pills */
.pill { display: inline-block; color: #fff; font-size: .72rem; font-weight: 500; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* Big progress ring for Phase 1 coverage */
.ring-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ring { width: 150px; height: 150px; border-radius: 50%; position: relative; flex-shrink: 0; }
.ring-hole { position: absolute; inset: 16px; background: #fff; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-value { font-size: 1.9rem; font-weight: 700; color: var(--ruby); line-height: 1; }
.ring-caption { font-size: .72rem; color: #777; margin-top: 4px; text-align: center; }

/* Donut */
.donut-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.donut { width: 160px; height: 160px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut-hole { position: absolute; inset: 26px; background: #fff; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-total { font-size: 1.5rem; font-weight: 700; }
.donut-caption { font-size: .72rem; color: #777; }
.donut-legend { flex: 1; min-width: 180px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #eee; font-size: .88rem; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.legend-label { flex: 1; }
.legend-value small { color: #888; }

/* Bar list */
.bar-row { display: grid; grid-template-columns: 170px 1fr 80px; gap: 10px; align-items: center; margin-bottom: 8px; }
.bar-label { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #f1eeee; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.bar-value { font-size: .85rem; text-align: right; }
@media (max-width: 600px) { .bar-row { grid-template-columns: 110px 1fr 60px; } }

/* Weekly columns */
.columns { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.column { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.column-bar { width: 100%; max-width: 42px; border-radius: 6px 6px 0 0; min-height: 2px; }
.column-value { font-size: .75rem; font-weight: 600; margin-bottom: 3px; }
.column-label { font-size: .65rem; color: #888; margin-top: 4px; text-align: center; line-height: 1.1; }

/* Purok coverage table */
.coverage-bar { background: #f1eeee; border-radius: 6px; height: 10px; overflow: hidden; min-width: 90px; }
.coverage-bar > div { height: 100%; border-radius: 6px; }

/* Concern / announcement rows */
.feed-row { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.feed-row:last-child { border-bottom: 0; }
.sms-bubble { background: #E8F5E9; border-radius: 12px 12px 12px 2px; padding: 10px 12px; max-width: 520px; white-space: pre-wrap; }
.sms-bubble small { color: #5b7a5e; display: block; margin-bottom: 4px; }

/* Units grid on the building page (condo floors) */
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.unit-cell { border: 1px solid #e6e1e1; border-radius: 8px; padding: 8px; background: #fff; cursor: pointer; min-height: 70px; }
.unit-cell:hover { box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.unit-cell .unit-no { font-weight: 600; font-size: .85rem; }
.unit-cell .unit-meta { font-size: .72rem; color: #666; line-height: 1.25; }
.unit-cell.none { border-style: dashed; background: #fafafa; }
.unit-cell.head { border-left: 4px solid #C9A227; }
.unit-cell.partial { border-left: 4px solid #0277BD; }
.unit-cell.complete { border-left: 4px solid #2E7D32; }
.unit-cell.vacant { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 6px, #f0f0f0 6px, #f0f0f0 12px); color: #888; }
.floor-label { font-size: .75rem; font-weight: 600; color: #777; margin: 10px 0 4px; }

/* Map */
.map-paper { border-radius: 12px; overflow: hidden; }
.briss-map { width: 100%; height: calc(100vh - 250px); min-height: 460px; border-radius: 10px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; }
.map-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: -1px; }
.concern-pin-inner { width: 22px; height: 22px; border-radius: 6px; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); font-size: 13px; }

.access-key { font-family: Consolas, "Courier New", monospace; font-size: 1.35rem; letter-spacing: .06em; background: #fafafa; border: 2px dashed var(--gold); border-radius: 8px; padding: 14px; text-align: center; user-select: all; word-break: break-all; }

.table-scroll { overflow-x: auto; }

/* ===== Identity pages (static SSR, Bootstrap) ===== */
.login-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, #9B111E 0%, #5e0a12 60%, #2b0508 100%); padding: 16px; }
.login-card { background: #fff; width: 100%; max-width: 460px; border-radius: 14px; padding: 28px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.login-card:has(.nav-pills) { max-width: 980px; }
.login-card .row:not(.g-2) > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
.login-card:has(.nav-pills) .row > .col-lg-4 { flex: 0 0 30%; max-width: 30%; }
.login-card:has(.nav-pills) .row > .col-lg-8 { flex: 0 0 70%; max-width: 70%; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login-brand h1 { margin: 0; font-size: 1.35rem; color: var(--ruby); font-weight: 700; }
.login-brand p { margin: 0; color: #777; font-size: .85rem; }
.login-logo { width: 52px; height: 52px; border-radius: 12px; background: var(--gold); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.login-card h1:not(.login-brand h1) { font-size: 1.25rem; }
.login-card h2, .login-card h3 { font-size: 1rem; color: #555; }
.login-card .btn-primary { background-color: var(--ruby); border-color: var(--ruby); }
.login-card .btn-primary:hover { background-color: var(--ruby-dark); border-color: var(--ruby-dark); }
.login-card a { color: var(--ruby); }
.login-demo { background: #fff8e1; border: 1px solid #f3dd9a; border-radius: 8px; padding: 10px 12px; font-size: .82rem; color: #5d4a00; margin-top: 14px; }
.login-footer { color: rgba(255,255,255,.75); font-size: .75rem; margin-top: 18px; }

.darker-border-checkbox.form-check-input { border-color: #929292; }
.validation-message { color: #e50000; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* Lobby poster (A4 portrait when printed) */
.poster { max-width: 640px; margin: 0 auto; background: #fff; border: 6px solid var(--ruby); border-radius: 18px; padding: 28px 32px; text-align: center; }
.poster-top { background: var(--ruby); color: #fff; margin: -28px -32px 18px; padding: 22px 24px; border-radius: 10px 10px 0 0; }
.poster-brgy { font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.poster-title { font-size: 2.2rem; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.poster-sub { font-size: 1rem; opacity: .9; margin-top: 6px; }
.poster-building { font-size: 1.3rem; font-weight: 700; color: #333; margin-bottom: 8px; }
.poster-qr { width: 330px; height: 330px; image-rendering: pixelated; }
.poster-url { font-family: Consolas, "Courier New", monospace; font-size: .95rem; color: #555; margin: 4px 0 14px; word-break: break-all; }
.poster-steps { text-align: left; font-size: 1rem; line-height: 1.45; margin: 0 0 12px; padding-left: 22px; }
.poster-steps i { color: #666; font-size: .9rem; display: block; }
.poster-why { background: #fff8e1; border-radius: 10px; padding: 10px 14px; font-size: .9rem; text-align: left; }
.poster-privacy { font-size: .78rem; color: #666; margin-top: 10px; text-align: left; }
.poster-footer { font-size: .72rem; color: #999; margin-top: 12px; }

@media print {
    .poster { border-width: 4px; max-width: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .no-print, .mud-appbar, .mud-drawer, .app-footer { display: none !important; }
    .mud-main-content { padding-top: 0 !important; margin-left: 0 !important; }
}

/* Brand mark and loading screen */
.brand-mark-img { width: 38px; height: 38px; margin-right: 8px; flex-shrink: 0; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.login-logo-img { width: 56px; height: 56px; flex-shrink: 0; }
.app-loading { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
               background: #9B111E; color: #fff; font-family: Roboto, Arial, sans-serif; }
.app-loading img { animation: app-loading-bob 1.6s ease-in-out infinite; }
.app-loading-ring { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #D4AF37; animation: app-loading-spin .9s linear infinite; }
.app-loading-text { font-size: .95rem; letter-spacing: .02em; opacity: .9; }
@keyframes app-loading-spin { to { transform: rotate(360deg); } }
@keyframes app-loading-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .app-loading img, .app-loading-ring { animation: none; } }

/* Online user manual */
.manual-toc-link { display: block; padding: 6px 8px; border-radius: 6px; color: inherit; text-decoration: none; font-size: .9rem; }
.manual-toc-link:hover { background: rgba(155,17,30,.07); color: #9B111E; }
.manual-section { scroll-margin-top: 80px; }
.manual-body { font-size: .95rem; line-height: 1.6; }
.manual-body p { margin: .5rem 0; }
.manual-body ol, .manual-body ul { margin: .4rem 0 .6rem; padding-left: 1.4rem; }
.manual-body li { margin: .2rem 0; }
.manual-body b { color: #6d0c15; }
.manual-table { width: 100%; border-collapse: collapse; margin: .5rem 0; font-size: .9rem; }
.manual-table th { background: #9B111E; color: #fff; text-align: left; padding: 7px 10px; font-weight: 500; }
.manual-table td { border-bottom: 1px solid #eee; padding: 7px 10px; vertical-align: top; }
.manual-table tr:nth-child(even) td { background: #fbf7f2; }
@media print {
    .manual-toolbar, .manual-toc, .mud-tabs-tabbar { display: none !important; }
    .manual-section { break-inside: avoid; border: none !important; }
}
