/* ============================================
   LGU SAN MATEO ROAD INVENTORY
   Production Stylesheet
   ============================================ */

/* ============================================
   ROOT VARIABLES & COLOR SCHEME
   ============================================ */
:root {
    --primary-color: #2d7a3e;
    --primary-dark: #1e4620;
    --primary-light: #4ca55f;
    --secondary-color: #b8860b; /* muted gold, more formal than bright orange */
    --secondary-bright: #f39c12; /* kept for badges/legend where contrast still needed */
    --success-color: #27ae60;
    --danger-color: #c0392b;
    --warning-color: #b8860b;
    --info-color: #2c6ea3;

    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #121212;
    --gray-600: #1b1d1b;
    --gray-700: #181d19;
    --gray-800: #202521;
    --gray-900: #1f201f;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 10px 28px rgba(0, 0, 0, 0.14);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition-base: all 0.18s ease-out;

    --focus-ring: 0 0 0 3px rgba(45, 122, 62, 0.45);

    /* Philippine flag colors, used only in the official-site banner strip */
    --ph-blue: #0038a8;
    --ph-red: #ce1126;
    --ph-gold: #fcd116;

    --sidebar-width: 260px;
    --topbar-height: 60px;
    --gov-banner-height: 32px;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* stop sideways scroll from oversized children */
}

/* Any media or embedded map inside content must never exceed its container */
img, video, iframe, .leaflet-container {
    max-width: 100%;
}

body {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    letter-spacing: 0.2px;
    -webkit-font-smoothing: antialiased;
}

/* Consistent, accessible focus state for every interactive element.
   Government systems must remain fully usable by keyboard. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.sidebar-link:focus-visible,
.barangay-item:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Respect users who have reduced-motion enabled */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Skip-to-content link (add <a class="skip-link" href="#main">Skip to content</a>
   as the first element in <body> in your templates) */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary-dark);
    color: #fff;
    padding: 0.75rem 1.25rem;
    z-index: 2000;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
}

/* ============================================
   OFFICIAL GOVERNMENT WEBSITE BANNER
   Same convention used on gov.ph sites: a slim
   identification strip above the main header that
   confirms this is an official government system.
   Markup:
   <div class="gov-banner">
     <div class="gov-banner-bar">
       <img src="/assets/ph-flag-icon.svg" alt="" class="gov-banner-flag">
       <span>An official website of the Local Government of San Mateo</span>
       <button class="gov-banner-toggle" aria-expanded="false" aria-controls="govBannerInfo">
         How to verify <i class="bi bi-chevron-down"></i>
       </button>
     </div>
     <div id="govBannerInfo" class="gov-banner-info" hidden>
       <p>Official LGU systems use secure <strong>.gov.ph</strong> domains or
       are accessed only through verified municipal hardware. Look for the
       lock icon in your browser's address bar before entering credentials.</p>
     </div>
   </div>
   ============================================ */
.gov-banner {
    background-color: var(--gray-900);
    color: #fff;
    font-size: 0.8rem;
}

.gov-banner-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.gov-banner-flag {
    width: 16px;
    height: 11px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.gov-banner-bar span {
    flex: 1;
    letter-spacing: 0.2px;
}

.gov-banner-toggle {
    background: none;
    border: none;
    color: #fff;
    text-decoration: underline;
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    white-space: nowrap;
}

.gov-banner-toggle:hover {
    color: var(--ph-gold);
}

.gov-banner-info {
    background-color: var(--gray-800);
    padding: 0.75rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gov-banner-info p {
    max-width: 1600px;
    margin: 0 auto;
    color: var(--gray-300);
    line-height: 1.5;
}

/* ============================================
   APP LAYOUT SHELL
   Wrap your topbar + sidebar + content in this
   structure so the sidebar can never be squeezed
   by surrounding flex/grid containers:
   <body>
     <div class="gov-banner">...</div>
     <header class="topbar">...</header>
     <div class="app-body">
       <aside class="sidebar">...</aside>
       <main class="content-wrapper" id="main">...</main>
     </div>
     <footer class="footer">...</footer>
   </body>
   ============================================ */
.app-body {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - var(--topbar-height) - var(--gov-banner-height));
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    max-width: none;
    display: block;
}

.content-wrapper {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 1.5rem 2rem;
}

/* ============================================
   TOPBAR / NAVBAR
   ============================================ */
.topbar {
    position: relative;
    z-index: 1000;
    background-color: #fff;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1.5rem !important;
    height: 60px !important;
    min-height: 60px !important;
    display: flex;
    align-items: center;
}

.topbar .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
}

.topbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.3px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-dark) !important;
}

.topbar .navbar-brand i {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.topbar .btn-outline-light {
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    background-color: transparent;
    transition: var(--transition-base);
}

.topbar .btn-outline-light:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

#sidebarToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    flex: 0 0 40px;
    cursor: pointer;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    pointer-events: auto;
}

#sidebarToggle:hover {
    background-color: var(--primary-color);
    color: #fff;
}


/* ============================================
   PAGE TITLES & HEADINGS
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: #fff;
    border: none;
    padding: 1.1rem 1.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   STAT CARD STYLES
   ============================================ */
.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.stat-card.stat-good .stat-icon { color: var(--success-color); }
.stat-card.stat-fair .stat-icon { color: var(--info-color); }
.stat-card.stat-poor .stat-icon { color: var(--danger-color); }
.stat-card.stat-repair .stat-icon { color: var(--warning-color); }
.stat-card.stat-construction .stat-icon { color: var(--secondary-color); }
.stat-card.stat-total .stat-icon { color: var(--primary-color); }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0.4rem 0;
}

.stat-card .stat-label {
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    letter-spacing: 0.2px;
    transition: var(--transition-base);
    border: none;
}

.d-flex > .btn,
.d-flex .btn {
    height: 2rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.btn:hover {
    filter: brightness(0.94);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    color: #fff;
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background-color: #747876;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background-color: #922b21;
}

.btn-secondary {
    background-color: var(--gray-500);
    color: #fff;
}

.btn-secondary:hover {
    background-color: var(--gray-700);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    height: 2rem;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    filter: none;
    transform: none;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-control,
.form-select {
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    height: 2rem;
    transition: var(--transition-base);
    background-color: #f2fbf2;
    color: var(--gray-900);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-500);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.3);
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    font-weight: 500;
}

.form-label {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    display: block;
    letter-spacing: 0.2px;
}

.form-label .required::after {
    content: " *";
    color: var(--danger-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.input-group .form-control {
    border-right: none;
}

.input-group-text {
    background-color: var(--gray-100);
    border: 1.5px solid var(--gray-300);
    border-left: none;
}

/* ============================================
   TABLE STYLES
   ============================================ */
.table {
    border-collapse: collapse;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--primary-dark);
    color: #fff;
    font-weight: 600;
    padding: 0.9rem 1rem;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.85rem;
}

.table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--gray-50);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fcfa 0%, #f6f6f6 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    background: #f6f9f5fd;
}

.login-card .card-body {
    padding: 2.5rem 2rem;
}

.login-card .text-center {
    margin-bottom: 2rem;
}

.login-card i {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.login-card h4 {
    color: var(--gray-900);
    font-weight: 700;
    margin-top: 1rem;
}

.login-card p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.login-card .alert {
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 500;
}

.login-card .form-control,
.login-card .form-select {
    height: 2.5rem;
    font-size: 1rem;
}

/* ============================================
   LOGIN & BACK BUTTONS
   ============================================ */

.login-card .login-btn,
.login-card .back-btn {
    width: 100%;
    display: block;
    padding: 12px 16px;
    margin-top: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* LOGIN BUTTON */
.login-card .login-btn {
    border: none;
    background-color: #2d7a3e;
    color: #ffffff;
}

/* LOGIN BUTTON HOVER */
.login-card .login-btn:hover {
    background-color: #1e5a2b;
    color: #ffffff;
}

/* BACK BUTTON */
.login-card .back-btn {
    background-color: #eef0ef;
    color: #374151;
    border: 1px solid #d8ded9;
}

/* BACK BUTTON HOVER */
.login-card .back-btn:hover {
    background-color: #e1e5e2;
    color: #374151;
}

/* BUTTON FOCUS */
.login-card .login-btn:focus,
.login-card .back-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.2);
}

/* BUTTON CLICK */
.login-card .login-btn:active,
.login-card .back-btn:active {
    transform: translateY(1px);
}
/* ============================================
   RECORD VIEW (view.php — road detail page)
   Matches the section layout in your screenshot:
   green uppercase section titles, bold field labels,
   value below. Tightened vertical rhythm so the page
   doesn't force scrolling to see the photo/map.

   Markup:
   <div class="record-view">
     <div class="record-section">
       <h6 class="record-section-title">Accountable Officer</h6>
       <div class="record-row">
         <div class="record-label">Accountable Officer</div>
         <div class="record-value">xiao xiao</div>
       </div>
       <div class="record-row">
         <div class="record-label">Official Designation</div>
         <div class="record-value">test124</div>
       </div>
     </div>

     <div class="record-section">
       <h6 class="record-section-title">Attachments</h6>
       <div class="record-media-grid">
         <figure class="record-media">
           <img src="..." alt="Road photo">
           <figcaption>Site Photo</figcaption>
         </figure>
         <figure class="record-media">
           <div id="viewMap" class="record-media-map"></div>
           <figcaption>Location</figcaption>
         </figure>
       </div>
     </div>
   </div>
   ============================================ */
.record-view {
    max-width: 900px;
}

.record-section {
    margin-bottom: 1.75rem;
}

.record-section-title {
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--gray-200);
}

.record-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    padding: 0.55rem 0; /* was effectively ~1.5rem+ before — this is the fix */
    border-bottom: 1px solid var(--gray-100);
}

.record-row:last-child {
    border-bottom: none;
}

.record-label {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.record-value {
    color: var(--gray-700);
    font-size: 0.95rem;
    word-break: break-word; /* long values wrap instead of pushing width */
}

/* Photo + map side by side, wrapping on small screens instead of overflowing */
.record-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* Use inside a narrow column (e.g. col-lg-4) where photo and map
   should stack vertically rather than compete for width */
.record-media-grid-stacked {
    grid-template-columns: 1fr;
}

.record-media-grid-stacked .record-media:not(:last-child) {
    margin-bottom: 1.25rem;
}

.record-media {
    margin: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-50);
}

.record-media img,
.record-photo {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.record-media-map {
    width: 100%;
    height: 220px;
}

.record-media figcaption {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 600;
    border-top: 1px solid var(--gray-200);
}

/* Standalone record photo/map cards (view.php sidebar) */
.record-photo {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.record-side-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .record-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

/* ============================================
   MAP VIEW — FULL SCREEN LAYOUT
   Two levels:
   1) Default map page: nav stays visible, but the
      map fills the entire content area edge-to-edge,
      with Filters/Legend/Barangay list floating over
      it instead of sitting in a side column.
   2) True fullscreen (toggle button + Fullscreen API):
      hides banner/topbar/sidebar/footer entirely so
      the map fills the whole browser viewport.

   Markup for the default full-bleed layout:
   <body class="map-page">
     ...
     <main class="content-wrapper" id="main">
       <div class="map-page-container">
         <div id="fullMap"></div>

         <div class="map-filters-panel">
           <h6>Filters</h6>
           ... barangay/condition selects, My Location, Toggle Satellite ...
         </div>

         <div class="map-legend">... existing legend markup ...</div>

         <button class="map-fullscreen-btn" id="mapFullscreenBtn"
                 aria-label="Toggle fullscreen map">
           <i class="bi bi-arrows-fullscreen"></i>
         </button>
       </div>
     </main>
   </body>

   JS for the fullscreen toggle button:
   const btn = document.getElementById('mapFullscreenBtn');
   const container = document.querySelector('.map-page-container');
   btn.addEventListener('click', () => {
     if (!document.fullscreenElement) {
       container.requestFullscreen();
     } else {
       document.exitFullscreen();
     }
   });
   ============================================ */

.map-page .app-body {
    height: calc(100vh - var(--topbar-height) - var(--gov-banner-height));
    overflow: hidden;
}

.map-page .content-wrapper {
    padding: 0;
    height: 100%;
}

.map-page-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.map-page #fullMap {
    height: 100%;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
}

/* Fullscreen API target: browser chrome drops away, so this
   fills the literal screen, not just the content area. */
.map-page-container:fullscreen {
    background: #000;
}

.map-page-container:fullscreen #fullMap {
    height: 100vh;
    width: 100vw;
}

/* Floating panels over the map, Google-Maps-style */
.map-filters-panel {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 500;
    width: 300px;
    max-width: calc(100% - 32px);
    max-height: calc(100% - 32px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
}

.map-filters-panel h6 {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 700;
    margin-bottom: 1rem;
}

.map-page .map-legend {
    top: 16px;
    right: 16px;
}

.map-fullscreen-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 500;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition-base);
}

.map-fullscreen-btn:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
}

/* Collapsible filters panel on mobile so it doesn't cover the whole map */
@media (max-width: 768px) {
    .map-page .app-body {
        height: calc(100vh - var(--topbar-height) - var(--gov-banner-height));
    }

    .map-page-container {
        min-height: calc(100vh - var(--topbar-height) - var(--gov-banner-height));
    }

    .map-filters-panel {
        width: calc(100% - 32px);
        max-height: 40%;
    }

    .map-filters-panel.collapsed {
        max-height: 44px;
        overflow: hidden;
    }
}

/* ============================================
   MAP STYLES (picker map, legend, barangay list)
   ============================================ */
#pickerMap {
    height: 400px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.map-wrapper {
    position: relative;
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

#fullMap {
    /* Fallback height if the page isn't wrapped in .map-page —
       prefer using the .map-page layout above for true full screen. */
    height: calc(100vh - 130px);
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
}

.barangay-list {
    max-height: 400px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    background-color: #fff;
}

.barangay-list::-webkit-scrollbar {
    width: 8px;
}

.barangay-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

.barangay-list::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 10px;
}

.barangay-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

.barangay-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 3px;
    cursor: pointer;
    color: var(--gray-800);
    font-weight: 500;
    transition: var(--transition-base);
}

.barangay-item:hover {
    background-color: var(--gray-100);
}

.barangay-item.active {
    background: var(--primary-dark);
    color: #fff;
    font-weight: 600;
}

.barangay-item.active .badge {
    background-color: var(--secondary-bright) !important;
    color: var(--primary-dark) !important;
    font-weight: 600;
}

.map-legend {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.97);
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    border: 1px solid var(--gray-200);
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
}

.map-legend-item:last-child {
    margin-bottom: 0;
}

/* ============================================
   ALERT & BADGE STYLES
   ============================================ */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.12);
    color: #1e8449;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(192, 57, 43, 0.10);
    color: #922b21;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: rgba(184, 134, 11, 0.12);
    color: #8a6508;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(44, 110, 163, 0.10);
    color: #1c496b;
    border-left: 4px solid var(--info-color);
}

.badge {
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
}

.badge.bg-success { background-color: var(--success-color) !important; }
.badge.bg-danger { background-color: var(--danger-color) !important; }
.badge.bg-warning { background-color: var(--warning-color) !important; color: #fff !important; }
.badge.bg-info { background-color: var(--info-color) !important; }
.badge.bg-primary { background-color: var(--primary-color) !important; }
.badge.bg-light { background-color: var(--gray-100) !important; color: var(--gray-800) !important; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: var(--gray-100);
    color: var(--gray-800);
    text-align: center;
    padding: 1.75rem;
    margin-top: auto;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    border-top: 2px solid var(--primary-color);
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* ============================================
   SIDEBAR NAVIGATION STYLES
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    background-color: #fff;
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-sm);
    height: calc(100vh - var(--topbar-height) - var(--gov-banner-height));
    position: sticky;
    top: calc(var(--topbar-height) + var(--gov-banner-height));
    transition: width 0.18s ease, min-width 0.18s ease, flex-basis 0.18s ease, opacity 0.12s ease;
}

/* Clean desktop collapse: removes the sidebar from layout. */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 0;
        min-width: 0;
        max-width: 0;
        flex-basis: 0;
        padding-left: 0;
        padding-right: 0;
        border-right: 0;
        opacity: 0;
        box-shadow: none;
        overflow: hidden;
    }

    .sidebar.collapsed .sidebar-header,
    .sidebar.collapsed .sidebar-nav {
        visibility: hidden;
    }

    .app-body > .main-content {
        flex: 1 1 0%;
        width: 0;
        min-width: 0;
        max-width: none;
    }

    .main-content .container,
    .main-content .container-fluid,
    .main-content .table-responsive {
        max-width: none;
        width: 100%;
    }
}

/* Official masthead / LGU seal */
.masthead {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.masthead-seal {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.masthead-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    font-weight: 600;
}

.masthead-subtitle {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-900);
}

.sidebar-header {
    background-color: var(--gray-100);
    color: var(--gray-800);
    border-bottom: 2px solid var(--primary-color);
}

.sidebar-header h6 {
    color: var(--gray-700);
    font-weight: 600;
    letter-spacing: 0.4px;
    margin-bottom: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: var(--transition-base);
    border-left: 4px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-link.active {
    background: rgba(45, 122, 62, 0.08);
    color: var(--primary-dark);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.sidebar-link i {
    min-width: 1.5rem;
    text-align: center;
    margin-right: 0.5rem;
}

.sidebar-link span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: calc(var(--topbar-height) + var(--gov-banner-height));
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    pointer-events: auto;
}

.sidebar-overlay.show {
    display: block;
}

/* ============================================
   MOBILE RESPONSIVE SIDEBAR
   ============================================ */
@media (max-width: 768px) {
    .sidebar-overlay.show {
        display: block;
    }

    .app-body {
        display: block;
        min-height: calc(100vh - var(--topbar-height) - var(--gov-banner-height));
    }

    .sidebar {
        position: fixed;
        top: calc(var(--topbar-height) + var(--gov-banner-height));
        left: 0;
        width: min(84vw, var(--sidebar-width));
        min-width: min(84vw, var(--sidebar-width));
        max-width: min(84vw, var(--sidebar-width));
        height: calc(100vh - var(--topbar-height) - var(--gov-banner-height));
        z-index: 999;
        border-right: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
        transition: transform 0.18s ease;
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: min(84vw, var(--sidebar-width));
        min-width: min(84vw, var(--sidebar-width));
        max-width: min(84vw, var(--sidebar-width));
        transform: translateX(-105%);
        opacity: 1;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .content-wrapper {
        width: 100%;
        min-width: 0;
        padding: 1rem;
    }

    #sidebarToggle {
        display: inline-flex !important;
        width: 40px;
        height: 36px;
    }

    .topbar {
        padding: 0.5rem 0.75rem !important;
        min-height: var(--topbar-height) !important;
    }

    .topbar .navbar-brand {
        min-width: 0;
        font-size: 0.95rem;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 700px;
    }

    .gov-banner-bar {
        padding: 0.35rem 0.75rem;
        font-size: 0.72rem;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        padding: 0.75rem;
    }

    .card-body {
        padding: 0.9rem;
    }

    .card-header {
        padding: 0.9rem 1rem;
    }

    .stat-card {
        padding: 0.9rem;
    }

    .stat-card .stat-value {
        font-size: 1.35rem;
    }

    .gov-banner-bar span {
        min-width: 0;
    }

    .gov-banner-toggle {
        font-size: 0.72rem;
    }
}

/* ============================================
   BREADCRUMB STYLES
   ============================================ */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
    gap: 0;
}

.breadcrumb-item {
    color: var(--gray-600);
    font-weight: 500;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--gray-800);
    font-weight: 600;
}

/* ============================================
   SPACING UTILITIES
   ============================================ */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.px-2 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-4 { padding-left: 2rem; padding-right: 2rem; }

/* ============================================
   TEXT / COLOR UTILITIES
   ============================================ */
.text-muted { color: var(--gray-600) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-primary { color: var(--primary-color) !important; }

.bg-light { background-color: var(--gray-100) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: 16px; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table {
        font-size: 0.9rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.7rem 0.5rem;
    }

    .topbar {
        padding: 0.75rem 1rem !important;
    }

    .topbar .navbar-brand {
        font-size: 1.05rem;
    }
}

/* ============================================
   PRINT STYLES
   For LGU reports that get printed / exported to PDF
   ============================================ */
@media print {
    .topbar,
    .sidebar,
    .sidebar-overlay,
    .footer,
    .btn,
    #sidebarToggle,
    .map-legend {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card,
    .table-responsive {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }

    .table thead th {
        background-color: #eee !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.75rem;
        color: #555;
    }
}
/* =========================================================
   MAP ROAD POPUP
   ========================================================= */

.road-map-popup {
    min-width: 240px;
    padding: 4px;
    font-family: inherit;
}

.road-popup-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e4620;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.road-popup-title i {
    font-size: 14px;
}

.road-popup-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 7px 0 10px;
}

.road-popup-info {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 12px;
}

.road-popup-info > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.popup-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    font-weight: 600;
}

.popup-value {
    font-size: 12px;
    color: #1f2937;
    font-weight: 500;
}

.road-popup-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 7px;
    background: #2d7a3e;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    transition: .2s ease;
}

.road-popup-button:hover {
    background: #1e4620;
    color: #fff !important;
}

/* ============================================================
   MODERN DASHBOARD ANALYTICS — ROAD MONITORING REDESIGN
   ============================================================ */
/* Readability overrides for the modern dashboard */
.dashboard-hero,
.dashboard-summary-card,
.dashboard-chart-card,
.dashboard-section-title,
.condition-kpi,
.attention-grid > div,
.ranking-item {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dashboard-hero p,
.chart-heading p,
.summary-note,
.section-context,
.condition-kpi-label,
.condition-kpi small,
.attention-grid small {
    color: #59636d;
}

.summary-label,
.section-kicker,
.chart-eyebrow,
.dashboard-hero-kicker {
    color: #2f6b45;
}

.summary-value,
.dashboard-section-title h3,
.chart-heading h4,
.dashboard-hero h1,
.condition-kpi strong,
.attention-main strong,
.attention-grid strong {
    color: #1f2933;
}

.ranking-item {
    color: #1f2933;
}

.ranking-number {
    background: #f0eee8;
    color: #2f6b45;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    background: linear-gradient(135deg, #f7f8f2 0%, #ffffff 58%, #fbf7f1 100%);
    border: 1px solid rgba(47, 92, 66, .12);
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .045);
}

.dashboard-hero-kicker,
.section-kicker {
    color: #2f6b45;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.dashboard-hero h1 {
    margin: .25rem 0 .2rem;
    color: #1f2933;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 850;
}

.dashboard-hero p {
    margin: 0;
    max-width: 780px;
    color: #56616d;
    font-size: .9rem;
}

.dashboard-hero-meta {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex: 0 0 auto;
    padding: .65rem .8rem;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(47, 92, 66, .13);
    border-radius: 12px;
}

.dashboard-hero-meta small,
.dashboard-hero-meta strong {
    display: block;
}

.dashboard-hero-meta small { color: #737b84; font-size: .67rem; }
.dashboard-hero-meta strong { color: #344054; font-size: .76rem; margin-top: .1rem; }
.dashboard-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #2f6b45; box-shadow: 0 0 0 5px rgba(47,107,69,.11); }

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-summary-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0;
    padding: 1.1rem 1.15rem;
    background: #fff;
    border: 1px solid #e9edf2;
    border-radius: 16px;
    box-shadow: 0 7px 24px rgba(15, 23, 42, .05);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.dashboard-summary-card::after {
    content: '';
    position: absolute;
    right: -28px;
    top: -28px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: rgba(47,107,69,.06);
}

.dashboard-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .075);
    border-color: rgba(47,107,69,.20);
}

.summary-icon {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-size: 1rem;
}

.summary-icon-road { background: #edf8f3; color: #2f6b45; }
.summary-icon-barangay { background: #f3eee3; color: #8b6a2b; }
.summary-icon-project { background: #f9eee5; color: #b85c2b; }
.summary-icon-cost { background: #f1ece7; color: #7a5b42; }

.summary-content { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; }
.summary-label { color: #56616d; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.summary-value { color: #1f2933; font-size: 1.44rem; line-height: 1.2; font-weight: 850; margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-value-currency { font-size: 1.14rem; }
.summary-note { color: #737b84; font-size: .71rem; margin-top: .16rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-note i { margin-left: .18rem; font-size: .6rem; }

.dashboard-section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}
.dashboard-section-title h3 { margin: .16rem 0 0; color: #1f2933; font-size: 1.04rem; font-weight: 850; }
.section-context { color: #737b84; font-size: .73rem; font-weight: 600; }
.section-link { color: #2f6b45; font-size: .74rem; font-weight: 800; text-decoration: none; }
.section-link:hover { color: #244f35; }

.dashboard-situation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 1rem;
}

.dashboard-performance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 1rem;
}

.dashboard-chart-card {
    border: 1px solid #e9edf2 !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: #fff;
}
.dashboard-chart-card .card-body { padding: 1.2rem 1.25rem 1.1rem; }

.chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .9rem;
    margin-bottom: 1rem;
}
.chart-heading h4 { color: #1f2933; font-size: 1rem; font-weight: 850; }
.chart-heading p { font-size: .78rem; }
.chart-eyebrow { display: block; margin-bottom: .22rem; color: #2f6b45; font-size: .63rem; font-weight: 850; letter-spacing: .10em; }
.chart-heading-icon { flex: 0 0 auto; width: 36px; height: 36px; display: inline-flex !important; align-items: center; justify-content: center; border-radius: 11px; background: #edf4ec; color: #2f6b45 !important; font-size: .86rem !important; }
.compact-heading { margin-bottom: .85rem; }

.condition-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
}
.condition-kpi {
    display: grid;
    grid-template-columns: 9px 1fr auto;
    align-items: center;
    column-gap: .45rem;
    row-gap: .08rem;
    padding: .75rem .78rem;
    border-radius: 12px;
    background: #f8fafb;
}
.condition-kpi-dot { width: 9px; height: 9px; border-radius: 50%; grid-row: span 2; }
.condition-kpi-label { color: #56616d; font-size: .7rem; font-weight: 700; }
.condition-kpi strong { color: #1f2933; font-size: 1.02rem; font-weight: 850; }
.condition-kpi small { grid-column: 2 / 3; color: #737b84; font-size: .65rem; font-weight: 700; }
.condition-good .condition-kpi-dot { background: #2f8a57; }
.condition-repair .condition-kpi-dot { background: #d9911a; }
.condition-construction .condition-kpi-dot { background: #c85f3b; }
.condition-progress-segment.condition-good { background: #2f8a57; }
.condition-progress-segment.condition-repair { background: #d9911a; }
.condition-progress-segment.condition-construction { background: #c85f3b; }

.condition-progress { display: flex; height: 12px; margin-top: 1rem; overflow: hidden; border-radius: 999px; background: #eef2f4; }
.condition-progress-segment { min-width: 0; transition: width .35s ease; }
.condition-progress-legend { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .62rem; }
.condition-progress-legend span { display: inline-flex; align-items: center; gap: .35rem; color: #56616d; font-size: .68rem; font-weight: 700; }
.condition-progress-legend .condition-kpi-dot { width: 8px; height: 8px; }

.attention-main { padding: .6rem 0 .9rem; }
.attention-main strong { display: block; color: #1f2933; font-size: 2.35rem; line-height: 1; font-weight: 900; }
.attention-main span { color: #56616d; font-size: .74rem; font-weight: 700; }
.attention-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .55rem; }
.attention-grid > div { padding: .68rem; border: 1px solid #edf0f2; border-radius: 11px; background: #fbfcfc; }
.attention-grid small, .attention-grid strong { display: block; }
.attention-grid small { color: #737b84; font-size: .63rem; line-height: 1.25; }
.attention-grid strong { color: #344054; font-size: .93rem; margin-top: .18rem; }
.attention-link { display: inline-flex; align-items: center; gap: .38rem; margin-top: .95rem; color: #2f6b45; font-size: .72rem; font-weight: 800; text-decoration: none; }
.attention-link:hover { color: #244f35; }

.modern-chart-wrapper { position: relative; width: 100%; }
.modern-chart-wrapper canvas { display: block; width: 100% !important; }
.modern-chart-ranking-compact { height: 250px; }
.modern-chart-cost-compact { height: 420px; }
.cost-chart-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.cost-chart-inner { position: relative; min-width: 1450px; height: 500px; }
.cost-chart-inner canvas { width: 1450px !important; height: 500px !important; display: block; }

.ranking-list { display: grid; gap: .48rem; }
.ranking-item { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: .6rem; padding: .58rem .62rem; color: inherit; text-decoration: none; border: 1px solid #edf0f2; border-radius: 11px; background: #fbfcfc; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.ranking-item:hover { background: #f5f8f1; border-color: rgba(47,107,69,.18); transform: translateX(2px); }
.ranking-number { width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: #eef3f2; color: #2f6b45; font-size: .72rem; font-weight: 850; }
.ranking-name { min-width: 0; color: #344054; font-size: .74rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-value { color: #1f2933; font-size: .74rem; font-weight: 850; }
.empty-ranking { color: #737b84; padding: 1rem 0; font-size: .78rem; }

.condition-matrix-wrap { overflow-x: auto; }
.condition-matrix-header,
.condition-matrix-row { min-width: 760px; display: grid; grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(110px, .8fr)) minmax(75px, .55fr); align-items: center; column-gap: .55rem; }
.condition-matrix-header { padding: .55rem .7rem; color: #737b84; font-size: .62rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.condition-matrix-header span:not(:first-child) { text-align: center; }
.condition-matrix-row { padding: .34rem .7rem; margin: .14rem 0; border: 1px solid transparent; border-radius: 11px; color: inherit; text-decoration: none; transition: background .16s ease, border-color .16s ease; }
.condition-matrix-row:hover { background: #fbfcfc; border-color: #edf0f2; }
.condition-matrix-row > strong { color: #344054; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matrix-cell, .matrix-total { min-height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: .7rem; font-weight: 800; }
.matrix-cell { background: #f7f9fa; }
.matrix-good { color: #15815d; }
.matrix-repair { color: #c47a00; }
.matrix-construction { color: #2766c7; }
.matrix-total { color: #344054; background: #f2f4f7; }
.matrix-note { display: flex; align-items: center; gap: .42rem; margin-top: .75rem; padding-top: .72rem; border-top: 1px solid #edf0f2; color: #737b84; font-size: .66rem; }

.scroll-target { scroll-margin-top: 95px; }

@media (max-width: 1100px) {
    .dashboard-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-situation-grid, .dashboard-performance-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 1rem; }
    .dashboard-hero-meta { width: 100%; }
    .dashboard-summary-grid { grid-template-columns: 1fr; gap: .75rem; }
    .dashboard-summary-card { padding: 1rem; }
    .dashboard-section-title { align-items: flex-start; flex-direction: column; gap: .4rem; }
    .condition-kpi-grid { grid-template-columns: 1fr; }
    .attention-grid { grid-template-columns: 1fr; }
    .modern-chart-ranking-compact { height: 300px; }
    .modern-chart-cost-compact { height: 390px; }
    .cost-chart-inner { min-width: 1250px; height: 470px; }
    .cost-chart-inner canvas { width: 1250px !important; height: 470px !important; }
    .dashboard-chart-card .card-body { padding: 1rem; }
}

@media (max-width: 480px) {
    .summary-value { font-size: 1.3rem; }
    .summary-value-currency { font-size: 1.02rem; }
    .dashboard-hero h1 { font-size: 1.3rem; }
    .chart-heading { gap: .6rem; }
    .chart-heading h4 { font-size: .94rem; }
}

/* Poor condition badge */
.bg-orange {
    background-color: #fd7e14 !important;
    color: #fff !important;
}

/* =========================================================
   MAP VIEW - ROAD NAMES PANEL
   ========================================================= */

.road-names-card {
    border: 1px solid #e9ecef;
    overflow: hidden;
}

/* =========================================================
   ROAD NAMES HEADER
   ========================================================= */

.road-names-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 10px;
}

.road-names-header h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.road-names-header h6 i {
    color: #2d7a3e;
    margin-right: 6px;
}

.road-names-header small {
    font-size: 11px;
}

/* =========================================================
   ROAD COUNT
   ========================================================= */

.road-count {
    min-width: 30px;
    height: 30px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 8px;

    background: #eaf5ec;
    color: #2d7a3e;

    border-radius: 50px;

    font-size: 12px;
    font-weight: 700;
}

/* =========================================================
   ROAD NAME LIST
   ========================================================= */

.road-name-list {
    max-height: 430px;
    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 4px;
}

/* =========================================================
   CUSTOM SCROLLBAR
   ========================================================= */

.road-name-list::-webkit-scrollbar {
    width: 6px;
}

.road-name-list::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 10px;
}

.road-name-list::-webkit-scrollbar-thumb {
    background: #b8c8bb;
    border-radius: 10px;
}

.road-name-list::-webkit-scrollbar-thumb:hover {
    background: #2d7a3e;
}

/* =========================================================
   ROAD NAME ITEM
   ========================================================= */

.road-name-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 10px 11px;

    margin-bottom: 7px;

    border: 1px solid #e4e9e5;

    border-radius: 9px;

    background: #f8faf9;

    color: #374151;

    text-align: left;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease,
        color 0.2s ease;
}

/* =========================================================
   ROAD ICON
   ========================================================= */

.road-name-icon {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eaf5ec;

    color: #2d7a3e;

    border-radius: 7px;

    font-size: 13px;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

/* =========================================================
   ROAD NAME TEXT
   ========================================================= */

.road-name-text {
    flex: 1;

    min-width: 0;

    font-size: 12px;
    font-weight: 600;

    line-height: 1.35;

    white-space: normal;
    word-break: break-word;
}

/* =========================================================
   RIGHT ARROW
   ========================================================= */

.road-name-arrow {
    flex: 0 0 auto;

    color: #9ca3af;

    font-size: 10px;

    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

/* =========================================================
   HOVER
   ========================================================= */

.road-name-item:hover {
    background: #eef8f0;

    border-color: #9bc6a3;

    color: #1f5f2d;

    transform: translateX(2px);

    box-shadow: 0 3px 8px rgba(45, 122, 62, 0.10);
}

.road-name-item:hover .road-name-icon {
    background: #2d7a3e;
    color: #ffffff;
}

.road-name-item:hover .road-name-arrow {
    color: #2d7a3e;
    transform: translateX(2px);
}

/* =========================================================
   ACTIVE / SELECTED ROAD
   ========================================================= */

.road-name-item.active {
    background: #2d7a3e;

    border-color: #2d7a3e;

    color: #ffffff;

    box-shadow: 0 4px 10px rgba(45, 122, 62, 0.22);
}

.road-name-item.active .road-name-icon {
    background: rgba(255, 255, 255, 0.18);

    color: #ffffff;
}

.road-name-item.active .road-name-arrow {
    color: #ffffff;

    transform: translateX(2px);
}

/* =========================================================
   EMPTY ROAD LIST
   ========================================================= */

.road-empty {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 20px 10px;

    color: #9ca3af;

    font-size: 12px;

    text-align: center;
}

.road-empty i {
    font-size: 16px;
    color: #adb5bd;
}

/* =========================================================
   SMALL SCREEN
   ========================================================= */

@media (max-width: 768px) {

    .road-name-list {
        max-height: 300px;
    }

    .road-name-item {
        padding: 9px 10px;
    }

    .road-name-text {
        font-size: 12px;
    }
}

/* =========================================================
   SIDEBAR OVERLAY SAFETY FIX
   Desktop/tablet: overlay must NEVER block the page.
   Mobile: overlay is controlled by JS only when sidebar is open.
   ========================================================= */
@media (min-width: 769px) {
    .sidebar-overlay,
    .sidebar-overlay.show {
        display: none !important;
        pointer-events: none !important;
    }
}

@media (max-width: 768px) {
    .sidebar-overlay {
        pointer-events: none;
    }

    .sidebar-overlay.show {
        display: block !important;
        pointer-events: auto;
    }
}


/* Dashboard navigation cards */
.dashboard-summary-card {
    color: inherit;
}

.dashboard-summary-card:focus-visible {
    outline: 3px solid rgba(45, 122, 62, 0.28);
    outline-offset: 2px;
}

html {
    scroll-behavior: smooth;
}

/* Barangay directory */
.barangay-directory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.barangay-directory-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    padding: 0.95rem 1rem;
    background: #fff;
    border: 1px solid rgba(31, 41, 55, 0.08);
    border-radius: 13px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.barangay-directory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.07);
    border-color: rgba(45, 122, 62, 0.2);
}

.barangay-directory-number {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(45, 122, 62, 0.10);
    color: #2d7a3e;
    font-weight: 800;
    font-size: 0.78rem;
}

.barangay-directory-content {
    min-width: 0;
}

.barangay-directory-content h5 {
    font-size: 0.96rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

@media (max-width: 992px) {
    .barangay-directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .barangay-directory-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ROAD STATUS SNAPSHOT CARDS
   ============================================================ */
.attention-grid-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.status-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 160px;
    padding: 16px;
    border: 1px solid rgba(31, 41, 55, 0.08);
    border-radius: 14px;
    text-decoration: none;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.10);
    text-decoration: none;
}

.status-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    margin-bottom: 4px;
    font-size: 15px;
}

.status-card-title {
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: #344054;
}

.status-card strong {
    font-size: 1.8rem;
    line-height: 1;
    color: #182230;
    margin-top: 2px;
}

.status-card small {
    font-size: .72rem;
    color: #667085;
    font-weight: 600;
}

.status-card-link {
    margin-top: auto;
    font-size: .73rem;
    font-weight: 800;
}

.status-card-repair { border-color: rgba(196, 122, 0, .20); }
.status-card-repair .status-card-icon { background: rgba(196, 122, 0, .12); color: #9a5f00; }
.status-card-repair .status-card-link { color: #9a5f00; }
.status-card-repair:hover { border-color: rgba(196, 122, 0, .38); }

.status-card-good { border-color: rgba(35, 128, 79, .20); }
.status-card-good .status-card-icon { background: rgba(35, 128, 79, .12); color: #176b42; }
.status-card-good .status-card-link { color: #176b42; }
.status-card-good:hover { border-color: rgba(35, 128, 79, .38); }

.status-card-pending { border-color: rgba(198, 90, 58, .20); }
.status-card-pending .status-card-icon { background: rgba(198, 90, 58, .12); color: #a3442d; }
.status-card-pending .status-card-link { color: #a3442d; }
.status-card-pending:hover { border-color: rgba(198, 90, 58, .38); }

.status-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(31, 41, 55, 0.07);
    color: #667085;
    font-size: .72rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .attention-grid-status {
        grid-template-columns: 1fr;
    }
    .status-card {
        min-height: 135px;
    }
    .status-card-footer {
        flex-direction: column;
    }
}

/* ============================================================
   BARANGAY ROAD HEALTH CARDS - DESIGN ONLY
   ============================================================ */
.barangay-health-section .card-body { padding: 1.25rem; }
.health-card-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #b8a98f #eeeae1;
    padding: 2px 2px 12px;
}
.health-card-grid {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 320px;
    gap: 14px;
    width: max-content;
}
.barangay-health-card {
    display: block;
    width: 360px;
    text-decoration: none;
    color: #243027;
    background: #fbfaf6;
    border: 1px solid #e3dfd4;
    border-radius: 16px;
    padding: 16px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.barangay-health-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(45, 57, 48, .10);
    border-color: #b8a98f;
}
.health-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.health-card-name { font-weight: 750; font-size: 1rem; color:#233128; }
.health-card-top > i { font-size:.78rem; color:#7d776d; }
.health-score-row { display:flex; align-items:center; gap:14px; margin:16px 0 13px; }
.health-ring {
    width:68px; height:68px; border-radius:50%; flex:0 0 68px;
    display:grid; place-items:center;
    background: conic-gradient(var(--health-color) var(--health), #e9e6dc 0);
    position:relative;
}
.health-ring::after { content:""; position:absolute; inset:6px; border-radius:50%; background:#fbfaf6; }
.health-ring span { position:relative; z-index:1; font-size:.95rem; font-weight:800; color:#26342b; }
.health-total { display:flex; flex-direction:column; }
.health-total small { font-size:.64rem; letter-spacing:.08em; font-weight:700; color:#7a776f; }
.health-total strong { font-size:1.35rem; line-height:1.15; color:#26342b; }
.health-stats { display:flex; flex-wrap:wrap; gap:8px 12px; font-size:.74rem; color:#5f655f; }
.health-stats span { display:inline-flex; align-items:center; gap:5px; }
.health-dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.health-dot.good { background:#2e7d50; }
.health-dot.repair { background:#d08a16; }
.health-dot.construction { background:#b9583e; }
.barangay-health-card.health-strong { --health-color:#2e7d50; }
.barangay-health-card.health-moderate { --health-color:#d08a16; }
.barangay-health-card.health-low { --health-color:#b9583e; }
@media (max-width: 768px) {
    .health-card-scroll { width: 100%; }
    .health-card-grid { grid-template-rows: minmax(0, 1fr); grid-auto-columns: 285px; gap: 10px; }
    .barangay-health-card { width: 285px; padding: 13px; }
    .health-score-row { gap: 10px; margin: 13px 0 10px; }
    .health-ring { width: 58px; height: 58px; flex-basis: 58px; }
    .health-total strong { font-size: 1.15rem; }
    .health-stats { font-size: .68rem; gap: 6px 9px; }
}
@media (max-width: 480px) {
    .health-card-grid { grid-auto-columns: 250px; }
    .barangay-health-card { width: 250px; }
}

/* ============================================================
   FINAL DASHBOARD VISUAL REFINEMENTS
   Design-only: preserves all existing functions and navigation.
   ============================================================ */
.condition-pie-wrap {
    position: relative;
    width: min(100%, 330px);
    height: 255px;
    margin: 8px auto 0;
}
.condition-pie-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.compact-leaderboard {
    display: grid;
    gap: 9px;
}
.compact-leader-row {
    display: grid;
    grid-template-columns: 34px minmax(130px, 1fr) minmax(110px, 2fr) auto 18px;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    text-decoration: none;
    color: #243027;
    background: #fbfaf6;
    border: 1px solid #e3dfd4;
    border-radius: 12px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.compact-leader-row:hover {
    transform: translateY(-1px);
    border-color: #b9ad99;
    box-shadow: 0 8px 18px rgba(45,57,48,.08);
    background: #fffdf8;
}
.compact-leader-rank {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ebe7dd;
    color: #5c5b55;
    font-weight: 800;
    font-size: .8rem;
}
.compact-leader-rank.rank-1 { background: #dfc27c; color: #5b4515; }
.compact-leader-rank.rank-2 { background: #d9d8d1; color: #4e504b; }
.compact-leader-rank.rank-3 { background: #dcb894; color: #5d3e27; }
.compact-leader-name { font-weight: 750; font-size: .92rem; color: #26342b; min-width: 0; }
.compact-leader-meter {
    height: 8px;
    background: #e9e6dd;
    border-radius: 99px;
    overflow: hidden;
}
.compact-leader-meter span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #2f7567, #4a9a89);
}
.compact-leader-value {
    color: #1f5d51;
    font-size: .82rem;
    white-space: nowrap;
}
.compact-leader-value small { font-size: .72rem; font-weight: 650; color: #6b756f; }
.compact-leader-arrow { color: #8a918d; font-size: .72rem; }

/* Full transparency chart: all barangays, alphabetical order, no value labels on bars. */
.modern-chart-cost-full {
    position: relative;
    width: 100%;
    height: 1080px;
}
.modern-chart-cost-full canvas {
    width: 100% !important;
    height: 100% !important;
}
.cost-transparency-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(31,41,55,.07);
    color: #667085;
    font-size: .72rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .compact-leader-row {
        grid-template-columns: 32px minmax(120px, 1fr) auto 16px;
    }
    .compact-leader-meter { display: none; }
    .modern-chart-cost-full { height: 1020px; }
}
@media (max-width: 576px) {
    .condition-pie-wrap { height: 235px; }
    .compact-leader-row { grid-template-columns: 30px minmax(0, 1fr) auto 14px; gap: 8px; padding: 10px; }
    .compact-leader-value { font-size: .75rem; }
    .modern-chart-cost-full { height: 940px; }
}
/* Add this patch at the END of your existing css/style.css */

/* ============================================================
   ROAD STATUS SNAPSHOT CARDS
   ============================================================ */
.attention-grid-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.status-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 160px;
    padding: 16px;
    border: 1px solid rgba(31, 41, 55, 0.08);
    border-radius: 14px;
    text-decoration: none;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.10);
    text-decoration: none;
}

.status-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    margin-bottom: 4px;
    font-size: 15px;
}

.status-card-title {
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: #344054;
}

.status-card strong {
    font-size: 1.8rem;
    line-height: 1;
    color: #182230;
    margin-top: 2px;
}

.status-card small {
    font-size: .72rem;
    color: #667085;
    font-weight: 600;
}

.status-card-link {
    margin-top: auto;
    font-size: .73rem;
    font-weight: 800;
}

.status-card-repair { border-color: rgba(196, 122, 0, .20); }
.status-card-repair .status-card-icon { background: rgba(196, 122, 0, .12); color: #9a5f00; }
.status-card-repair .status-card-link { color: #9a5f00; }
.status-card-repair:hover { border-color: rgba(196, 122, 0, .38); }

.status-card-good { border-color: rgba(35, 128, 79, .20); }
.status-card-good .status-card-icon { background: rgba(35, 128, 79, .12); color: #176b42; }
.status-card-good .status-card-link { color: #176b42; }
.status-card-good:hover { border-color: rgba(35, 128, 79, .38); }

.status-card-pending { border-color: rgba(198, 90, 58, .20); }
.status-card-pending .status-card-icon { background: rgba(198, 90, 58, .12); color: #a3442d; }
.status-card-pending .status-card-link { color: #a3442d; }
.status-card-pending:hover { border-color: rgba(198, 90, 58, .38); }

.status-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(31, 41, 55, 0.07);
    color: #667085;
    font-size: .72rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .attention-grid-status {
        grid-template-columns: 1fr;
    }
    .status-card {
        min-height: 135px;
    }
    .status-card-footer {
        flex-direction: column;
    }
}

/* ============================================================
   BARANGAY ROAD HEALTH CARDS - DESIGN ONLY
   ============================================================ */
.barangay-health-section .card-body { padding: 1.25rem; }
.health-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}
.barangay-health-card {
    display: block;
    text-decoration: none;
    color: #243027;
    background: #fbfaf6;
    border: 1px solid #e3dfd4;
    border-radius: 16px;
    padding: 16px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.barangay-health-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(45, 57, 48, .10);
    border-color: #b8a98f;
}
.health-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.health-card-name { font-weight: 750; font-size: 1rem; color:#233128; }
.health-card-top > i { font-size:.78rem; color:#7d776d; }
.health-score-row { display:flex; align-items:center; gap:14px; margin:16px 0 13px; }
.health-ring {
    width:68px; height:68px; border-radius:50%; flex:0 0 68px;
    display:grid; place-items:center;
    background: conic-gradient(var(--health-color) var(--health), #e9e6dc 0);
    position:relative;
}
.health-ring::after { content:""; position:absolute; inset:6px; border-radius:50%; background:#fbfaf6; }
.health-ring span { position:relative; z-index:1; font-size:.95rem; font-weight:800; color:#26342b; }
.health-total { display:flex; flex-direction:column; }
.health-total small { font-size:.64rem; letter-spacing:.08em; font-weight:700; color:#7a776f; }
.health-total strong { font-size:1.35rem; line-height:1.15; color:#26342b; }
.health-stats { display:flex; flex-wrap:wrap; gap:8px 12px; font-size:.74rem; color:#5f655f; }
.health-stats span { display:inline-flex; align-items:center; gap:5px; }
.health-dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.health-dot.good { background:#2e7d50; }
.health-dot.repair { background:#d08a16; }
.health-dot.construction { background:#b9583e; }
.barangay-health-card.health-strong { --health-color:#2e7d50; }
.barangay-health-card.health-moderate { --health-color:#d08a16; }
.barangay-health-card.health-low { --health-color:#b9583e; }
@media (max-width: 768px) {
    .health-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap:10px; }
    .barangay-health-card { padding:13px; }
    .health-score-row { gap:10px; margin:13px 0 10px; }
    .health-ring { width:58px; height:58px; flex-basis:58px; }
    .health-total strong { font-size:1.15rem; }
    .health-stats { font-size:.68rem; gap:6px 9px; }
}
@media (max-width: 480px) {
    .health-card-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   FINAL DASHBOARD VISUAL REFINEMENTS
   Design-only: preserves all existing functions and navigation.
   ============================================================ */
.condition-pie-wrap {
    position: relative;
    width: min(100%, 330px);
    height: 255px;
    margin: 8px auto 0;
}
.condition-pie-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.compact-leaderboard {
    display: grid;
    gap: 9px;
}
.compact-leader-row {
    display: grid;
    grid-template-columns: 34px minmax(130px, 1fr) minmax(110px, 2fr) auto 18px;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    text-decoration: none;
    color: #243027;
    background: #fbfaf6;
    border: 1px solid #e3dfd4;
    border-radius: 12px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.compact-leader-row:hover {
    transform: translateY(-1px);
    border-color: #b9ad99;
    box-shadow: 0 8px 18px rgba(45,57,48,.08);
    background: #fffdf8;
}
.compact-leader-rank {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ebe7dd;
    color: #5c5b55;
    font-weight: 800;
    font-size: .8rem;
}
.compact-leader-rank.rank-1 { background: #dfc27c; color: #5b4515; }
.compact-leader-rank.rank-2 { background: #d9d8d1; color: #4e504b; }
.compact-leader-rank.rank-3 { background: #dcb894; color: #5d3e27; }
.compact-leader-name { font-weight: 750; font-size: .92rem; color: #26342b; min-width: 0; }
.compact-leader-meter {
    height: 8px;
    background: #e9e6dd;
    border-radius: 99px;
    overflow: hidden;
}
.compact-leader-meter span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #2f7567, #4a9a89);
}
.compact-leader-value {
    color: #1f5d51;
    font-size: .82rem;
    white-space: nowrap;
}
.compact-leader-value small { font-size: .72rem; font-weight: 650; color: #6b756f; }
.compact-leader-arrow { color: #8a918d; font-size: .72rem; }

/* Full transparency chart: all barangays, alphabetical order, no value labels on bars. */
.modern-chart-cost-full {
    position: relative;
    width: 100%;
    height: 1080px;
}
.modern-chart-cost-full canvas {
    width: 100% !important;
    height: 100% !important;
}
.cost-transparency-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(31,41,55,.07);
    color: #667085;
    font-size: .72rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .compact-leader-row {
        grid-template-columns: 32px minmax(120px, 1fr) auto 16px;
    }
    .compact-leader-meter { display: none; }
    .modern-chart-cost-full { height: 1020px; }
}
@media (max-width: 576px) {
    .condition-pie-wrap { height: 235px; }
    .compact-leader-row { grid-template-columns: 30px minmax(0, 1fr) auto 14px; gap: 8px; padding: 10px; }
    .compact-leader-value { font-size: .75rem; }
    .modern-chart-cost-full { height: 940px; }
}

/* =========================================================
   MOBILE UI POLISH - SAVED ROAD DATA / ALL PAGES
   Visual/responsive only. No feature or database changes.
   ========================================================= */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Keep the topbar on one row and prevent controls from wrapping. */
    .topbar {
        flex-wrap: nowrap !important;
        width: 100%;
        overflow: hidden;
    }

    .topbar > .d-flex:first-child {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden;
    }

    .topbar > .d-flex:last-child {
        flex: 0 0 auto !important;
        min-width: max-content;
        gap: 0.35rem !important;
    }

    .topbar .navbar-brand {
        display: flex;
        align-items: center;
        min-width: 0 !important;
        max-width: 100%;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-size: 0.88rem !important;
        line-height: 1.1;
    }

    .topbar .navbar-brand > i {
        flex: 0 0 auto;
    }

    #sidebarToggle {
        flex: 0 0 40px !important;
        min-width: 40px !important;
    }

    .topbar .btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* Breadcrumb should never collide with the topbar. */
    .page-header {
        width: 100%;
        overflow: hidden;
    }

    .page-header .px-4,
    .page-header > div {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .breadcrumb {
        font-size: 0.84rem;
        flex-wrap: nowrap;
        overflow: hidden;
        white-space: nowrap;
    }

    .breadcrumb-item {
        min-width: 0;
    }

    .breadcrumb-item:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Saved Road Data page header. */
    .content-wrapper > .d-flex.justify-content-between {
        align-items: flex-start !important;
    }

    .content-wrapper > .d-flex.justify-content-between > div:first-child {
        min-width: 0;
        flex: 1 1 auto;
    }

    .content-wrapper > .d-flex.justify-content-between h2 {
        font-size: 1.45rem;
        line-height: 1.2;
    }

    .content-wrapper > .d-flex.justify-content-between p {
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .content-wrapper > .d-flex.justify-content-between .btn {
        flex: 0 0 auto;
    }

    /* Search area: don't allow the input group itself to cause page overflow. */
    .card,
    .table-responsive {
        max-width: 100%;
    }

    .input-group {
        width: 100%;
        flex-wrap: nowrap !important;
    }

    .input-group > .form-control {
        min-width: 0 !important;
        width: 1% !important;
        flex: 1 1 auto !important;
        font-size: 0.95rem;
    }

    .input-group > .btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* Table remains fully functional through horizontal scrolling,
       but the page itself will never scroll sideways. */
    .table-responsive {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .table-responsive > .table {
        min-width: 760px !important;
        width: 760px !important;
        max-width: none !important;
        margin-bottom: 0;
    }

    .table-responsive table th,
    .table-responsive table td {
        white-space: nowrap;
        vertical-align: middle;
    }

    .table-responsive table th {
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .table-responsive table td {
        font-size: 0.84rem;
    }

    /* Keep action controls readable inside the scrollable table. */
    .table-responsive td.text-end {
        min-width: 220px;
        white-space: nowrap;
    }

    .table-responsive td.text-end .btn {
        margin: 0.12rem;
    }

    /* Admin audit columns get enough room but stay inside the table scroller. */
    .table-responsive td small {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding-left: 0.55rem !important;
        padding-right: 0.55rem !important;
    }

    .topbar .navbar-brand {
        font-size: 0.82rem !important;
    }

    .topbar > .d-flex:last-child {
        gap: 0.2rem !important;
    }

    .topbar > .d-flex:last-child .btn {
        padding-left: 0.45rem !important;
        padding-right: 0.45rem !important;
    }

    .content-wrapper > .d-flex.justify-content-between h2 {
        font-size: 1.28rem;
    }

    .content-wrapper > .d-flex.justify-content-between p {
        font-size: 0.88rem;
    }

    .table-responsive > .table {
        min-width: 720px !important;
        width: 720px !important;
    }

    .table-responsive td.text-end {
        min-width: 210px;
    }
}


/* ============================================================
   FINAL DASHBOARD ACTION LINKS + SAVED ROAD ACTIONS
   Design-only. Preserves existing URLs and PHP behavior.
   ============================================================ */
.section-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    color: #2f6b45 !important;
    font-size: .76rem;
    line-height: 1.2;
    font-weight: 800;
    text-decoration: none !important;
    padding: 8px 12px;
    border: 1px solid rgba(47,107,69,.24);
    border-radius: 10px;
    background: #f7faf7;
    box-shadow: 0 2px 8px rgba(31,41,55,.05);
    transition: transform .16s ease, color .16s ease, background-color .16s ease,
                border-color .16s ease, box-shadow .16s ease;
}
.section-action-link:hover,
.section-action-link:focus {
    color: #1f5b38 !important;
    background: #edf6ef;
    border-color: rgba(47,107,69,.38);
    box-shadow: 0 6px 14px rgba(31,41,55,.08);
    transform: translateY(-1px);
    text-decoration: none !important;
}
.section-action-link i {
    font-size: .7rem;
}

.saved-road-actions {
    white-space: nowrap;
}
.saved-road-actions > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 74px;
    margin: 2px 0 2px 5px;
    padding: .4rem .65rem;
    border-radius: 9px;
    font-weight: 750;
    line-height: 1.2;
    box-shadow: 0 2px 7px rgba(31,41,55,.06);
}
.saved-road-actions > .btn-outline-primary {
    color: #2f6b45;
    border-color: #2f6b45;
    background: #fff;
}
.saved-road-actions > .btn-outline-primary:hover,
.saved-road-actions > .btn-outline-primary:focus {
    color: #fff;
    background: #2f6b45;
    border-color: #2f6b45;
}
.saved-road-actions > .btn-outline-warning {
    color: #9a650c;
    border-color: #d09a38;
    background: #fffdfa;
}
.saved-road-actions > .btn-outline-danger {
    color: #b44732;
    border-color: #c9644e;
    background: #fffafa;
}

@media (max-width: 768px) {
    .dashboard-section-title {
        align-items: flex-start;
        gap: 10px;
    }
    .section-action-link {
        font-size: .68rem;
        padding: 7px 9px;
        border-radius: 9px;
        white-space: nowrap;
    }
    .saved-road-actions > .btn {
        min-width: 68px;
        margin-left: 3px;
        padding: .38rem .55rem;
        font-size: .72rem;
    }
}
/* ============================================================
   DESKTOP / LAPTOP DASHBOARD FIX
   Design-only. No PHP, JS, DB, or navigation changes.
   ============================================================ */

/* ------------------------------------------------------------
   1. MUNICIPAL ROAD STATUS
   ------------------------------------------------------------ */
@media (min-width: 769px) {

    .dashboard-attention-card,
    .dashboard-attention-card .card-body {
        width: 100%;
    }

    .attention-grid-status {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
        margin-top: 16px !important;
    }

    .attention-grid-status .status-card {
        display: flex !important;
        flex-direction: column !important;
        position: relative;
        min-width: 0 !important;
        min-height: 165px !important;
        padding: 17px !important;

        background: #ffffff !important;
        border: 1px solid rgba(31, 41, 55, 0.08) !important;
        border-radius: 15px !important;

        text-decoration: none !important;
        box-sizing: border-box;

        transition:
            transform .18s ease,
            box-shadow .18s ease,
            border-color .18s ease;
    }

    .attention-grid-status .status-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(31, 41, 55, .10);
        text-decoration: none !important;
    }

    .attention-grid-status .status-card-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;

        width: 38px !important;
        height: 38px !important;
        flex: 0 0 38px;

        border-radius: 11px;
        margin-bottom: 6px;

        font-size: 15px;
    }

    .attention-grid-status .status-card-title {
        display: block !important;
        margin-top: 2px;

        font-size: .84rem !important;
        font-weight: 800 !important;
        color: #344054 !important;
    }

    .attention-grid-status .status-card strong {
        display: block !important;

        margin-top: 4px;
        font-size: 1.9rem !important;
        line-height: 1 !important;
        font-weight: 850 !important;

        color: #182230 !important;
    }

    .attention-grid-status .status-card small {
        display: block !important;
        margin-top: 4px;

        font-size: .73rem !important;
        font-weight: 600 !important;
        color: #667085 !important;
    }

    .attention-grid-status .status-card-link {
        display: block !important;
        margin-top: auto !important;
        padding-top: 12px;

        font-size: .73rem !important;
        font-weight: 800 !important;
    }

    .attention-grid-status .status-card-footer {
        display: flex !important;
        align-items: center;
        justify-content: space-between;

        gap: 15px;
        margin-top: 15px;
        padding-top: 10px;

        border-top: 1px solid rgba(31, 41, 55, 0.07);

        font-size: .72rem;
        color: #667085;
    }


    /* --------------------------------------------------------
       2. TOP 5 PERFORMING BARANGAYS
       -------------------------------------------------------- */

    .dashboard-performance-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1rem !important;
    }

    .dashboard-performance-grid .dashboard-chart-card {
        min-width: 0;
        width: 100%;
        background: #ffffff !important;
        border: 1px solid #e9edf2 !important;
        border-radius: 16px !important;
        overflow: hidden;
    }

    .dashboard-performance-grid .card-body {
        padding: 1.2rem !important;
    }

    .dashboard-performance-grid .chart-heading {
        display: flex !important;
        align-items: flex-start;
        justify-content: space-between;

        gap: 15px;
        margin-bottom: 14px;
    }

    .dashboard-performance-grid .chart-heading h4 {
        margin: 0 0 4px !important;

        font-size: 1rem !important;
        line-height: 1.25;
        font-weight: 850 !important;
        color: #1f2933 !important;
    }

    .dashboard-performance-grid .chart-heading p {
        margin: 0 !important;

        font-size: .75rem !important;
        line-height: 1.45;

        color: #59636d !important;
    }

    .dashboard-performance-grid .chart-eyebrow {
        display: block;
        margin-bottom: 3px;

        font-size: .64rem !important;
        font-weight: 850 !important;
        letter-spacing: .11em;

        color: #2f6b45 !important;
        text-transform: uppercase;
    }

    .dashboard-performance-grid .modern-chart-ranking-compact {
        position: relative;
        width: 100% !important;
        min-height: 300px;

        overflow: hidden;
    }

    .dashboard-performance-grid .modern-chart-ranking-compact canvas {
        display: block;
        width: 100% !important;
        max-width: 100%;
    }


    /* --------------------------------------------------------
       3. BARANGAY ROAD HEALTH
       -------------------------------------------------------- */

    .barangay-health-section {
        width: 100%;
        overflow: hidden;
    }

    .barangay-health-section .card-body {
        width: 100%;
        padding: 1.25rem !important;
        box-sizing: border-box;
    }

    /* Important: preserve horizontal scrolling on laptop */
    .health-card-scroll {
        width: 100%;
        max-width: 100%;

        overflow-x: auto !important;
        overflow-y: hidden;

        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;

        padding: 4px 2px 14px;
        box-sizing: border-box;
    }

    .health-card-grid {
        display: grid !important;

        grid-template-columns: none !important;
        grid-template-rows: minmax(0, 1fr) !important;

        grid-auto-flow: column !important;
        grid-auto-columns: 320px !important;

        gap: 14px !important;

        width: max-content !important;
        min-width: max-content !important;
    }

    .health-card-grid .barangay-health-card {
        display: block !important;

        width: 320px !important;
        min-width: 320px !important;

        box-sizing: border-box;

        padding: 16px !important;

        background: #fbfaf6 !important;
        border: 1px solid #e3dfd4 !important;
        border-radius: 16px !important;

        color: #243027 !important;
        text-decoration: none !important;

        transition:
            transform .18s ease,
            box-shadow .18s ease,
            border-color .18s ease;
    }

    .health-card-grid .barangay-health-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 26px rgba(45, 57, 48, .10);
        border-color: #b8a98f;
        text-decoration: none !important;
    }

    .health-card-grid .health-card-top {
        display: flex !important;
        align-items: center;
        justify-content: space-between;

        gap: 10px;
    }

    .health-card-grid .health-card-name {
        min-width: 0;

        font-size: .98rem !important;
        font-weight: 800 !important;
        line-height: 1.25;

        color: #233128 !important;
    }

    .health-card-grid .health-score-row {
        display: flex !important;
        align-items: center;

        gap: 14px !important;
        margin: 16px 0 13px !important;
    }

    .health-card-grid .health-ring {
        display: grid !important;
        place-items: center;

        width: 68px !important;
        height: 68px !important;
        min-width: 68px !important;
        flex: 0 0 68px !important;

        border-radius: 50%;

        background:
            conic-gradient(
                var(--health-color)
                var(--health),
                #e9e6dc 0
            ) !important;
    }

    .health-card-grid .health-ring span {
        position: relative;
        z-index: 1;

        font-size: .95rem !important;
        font-weight: 850 !important;

        color: #26342b !important;
    }

    .health-card-grid .health-total {
        display: flex !important;
        flex-direction: column;
        min-width: 0;
    }

    .health-card-grid .health-total small {
        font-size: .62rem !important;
        font-weight: 750 !important;
        letter-spacing: .08em;

        color: #7a776f !important;
    }

    .health-card-grid .health-total strong {
        font-size: 1.35rem !important;
        line-height: 1.15;

        color: #26342b !important;
        font-weight: 850 !important;
    }

    .health-card-grid .health-stats {
        display: flex !important;
        flex-wrap: wrap !important;

        gap: 8px 12px !important;

        font-size: .73rem !important;
        line-height: 1.3;

        color: #5f655f !important;
    }

    .health-card-grid .health-stats span {
        display: inline-flex !important;
        align-items: center;

        gap: 5px;
    }


    /* --------------------------------------------------------
       4. DASHBOARD SECTION TITLES
       -------------------------------------------------------- */

    .dashboard-section-title {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: space-between !important;

        gap: 15px;
        width: 100%;

        box-sizing: border-box;
    }

    .dashboard-section-title > div {
        min-width: 0;
    }

    .dashboard-section-title h3 {
        margin: .16rem 0 0 !important;

        font-size: 1.04rem !important;
        font-weight: 850 !important;

        color: #1f2933 !important;
    }

    .dashboard-section-title .section-context,
    .dashboard-section-title .section-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }


    /* --------------------------------------------------------
       5. GENERAL LAPTOP DASHBOARD CARD FIX
       -------------------------------------------------------- */

    .dashboard-chart-card,
    .dashboard-condition-card,
    .dashboard-attention-card {
        box-sizing: border-box;
        min-width: 0;
    }

    .dashboard-chart-card .card-body {
        min-width: 0;
        box-sizing: border-box;
    }

}


/* ============================================================
   TABLET / SMALL LAPTOP
   ============================================================ */

@media (min-width: 769px) and (max-width: 1100px) {

    .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .dashboard-situation-grid {
        grid-template-columns: 1fr !important;
    }

    .attention-grid-status {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .health-card-grid {
        grid-auto-columns: 290px !important;
    }

    .health-card-grid .barangay-health-card {
        width: 290px !important;
        min-width: 290px !important;
    }

}


/* ============================================================
   LAPTOP 1101px AND ABOVE
   ============================================================ */

@media (min-width: 1101px) {

    .dashboard-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .dashboard-situation-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr) !important;
    }

    .attention-grid-status {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .health-card-grid {
        grid-auto-columns: 320px !important;
    }

}


/* ============================================================
   IMPORTANT DESKTOP OVERRIDES
   Prevent old Bootstrap / generic rules from flattening
   the custom dashboard components.
   ============================================================ */

@media (min-width: 769px) {

    .status-card,
    .barangay-health-card,
    .compact-leader-row {
        font-family:
            Inter,
            ui-sans-serif,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            sans-serif !important;
    }

    .status-card a,
    .barangay-health-card a,
    .compact-leader-row a {
        text-decoration: none !important;
    }

    .status-card:hover,
    .barangay-health-card:hover,
    .compact-leader-row:hover {
        text-decoration: none !important;
    }

    .health-card-grid *,
    .attention-grid-status *,
    .dashboard-performance-grid * {
        box-sizing: border-box;
    }

}
/* ============================================================
   SUBTLE STATUS BORDER GLOW
   Border only
   ============================================================ */

/* General cards */
.dashboard-chart-card,
.dashboard-condition-card,
.dashboard-attention-card,
.dashboard-summary-card,
.compact-leader-row {
    border-color: rgba(47, 107, 69, 0.18) !important;
    box-shadow: 0 0 6px rgba(47, 107, 69, 0.08);
    transition: border-color .2s ease, box-shadow .2s ease;
}

/* Good = Green */
.status-card-good {
    border-color: rgba(46, 125, 80, 0.28) !important;
    box-shadow: 0 0 7px rgba(46, 125, 80, 0.10);
}

.status-card-good:hover {
    border-color: rgba(46, 125, 80, 0.52) !important;
    box-shadow: 0 0 12px rgba(46, 125, 80, 0.18);
}

/* For Repair = Gold */
.status-card-repair {
    border-color: rgba(208, 138, 22, 0.28) !important;
    box-shadow: 0 0 7px rgba(208, 138, 22, 0.10);
}

.status-card-repair:hover {
    border-color: rgba(208, 138, 22, 0.52) !important;
    box-shadow: 0 0 12px rgba(208, 138, 22, 0.18);
}

/* Under Construction = Red/Orange */
.status-card-pending {
    border-color: rgba(185, 88, 62, 0.28) !important;
    box-shadow: 0 0 7px rgba(185, 88, 62, 0.10);
}

.status-card-pending:hover {
    border-color: rgba(185, 88, 62, 0.52) !important;
    box-shadow: 0 0 12px rgba(185, 88, 62, 0.18);
}

/* Barangay Health cards */
.barangay-health-card {
    border-color: rgba(47, 107, 69, 0.20) !important;
    box-shadow: 0 0 6px rgba(47, 107, 69, 0.07);
}

.barangay-health-card:hover {
    border-color: rgba(47, 107, 69, 0.42) !important;
    box-shadow: 0 0 11px rgba(47, 107, 69, 0.14);
}

/* Top 5 rows */
.compact-leader-row {
    border-color: rgba(47, 107, 69, 0.18) !important;
    box-shadow: 0 0 6px rgba(47, 107, 69, 0.07);
}

.compact-leader-row:hover {
    border-color: rgba(47, 107, 69, 0.40) !important;
    box-shadow: 0 0 11px rgba(47, 107, 69, 0.13);
}