
:root{
    --mpi-primary:#243B6B;
    --mpi-secondary:#3E8EDE;
    --mpi-bg:#F5F7FB;
    --mpi-sidebar:#152238;
    --mpi-border:#E5E7EB;
}
body{
    background:var(--mpi-bg);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color:#1f2937;
}
.auth-wrapper{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#152238,#243B6B,#3E8EDE);
}
.auth-card{
    width:100%;
    max-width:430px;
    background:#fff;
    border-radius:22px;
    padding:34px;
    box-shadow:0 25px 80px rgba(0,0,0,.25);
}
.admin-shell{display:flex; min-height:100vh;}
.sidebar{
    width:280px;
    background:var(--mpi-sidebar);
    color:#fff;
    position:fixed;
    top:0; bottom:0; left:0;
    overflow-y:auto;
    z-index:1000;
}
.sidebar .brand{
    padding:22px;
    font-weight:800;
    font-size:20px;
    border-bottom:1px solid rgba(255,255,255,.08);
}
.sidebar .nav-link{
    color:rgba(255,255,255,.76);
    padding:11px 20px;
    border-radius:12px;
    margin:3px 12px;
    font-size:14px;
}
.sidebar .nav-link:hover,.sidebar .nav-link.active{
    color:#fff;
    background:rgba(255,255,255,.11);
}
.nav-section-label{
    font-size:10px;
    font-weight:700;
    letter-spacing:.1em;
    text-transform:uppercase;
    color:rgba(255,255,255,.35);
    padding:16px 20px 4px;
    margin-top:4px;
}
.main-content{
    margin-left:280px;
    width:calc(100% - 280px);
}
.topbar{
    height:72px;
    background:#fff;
    border-bottom:1px solid var(--mpi-border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 28px;
    position:sticky;
    top:0;
    z-index:900;
}
.topbar-avatar{
    width:32px; height:32px; border-radius:10px;
    background:#243B6B; color:#fff;
    display:grid; place-items:center;
    font-size:12px; font-weight:800;
    flex-shrink:0;
}
.topbar-username{
    max-width:160px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.page-content{padding:28px;}
.card{
    border:1px solid var(--mpi-border);
    border-radius:18px;
    box-shadow:0 8px 24px rgba(15,23,42,.04);
}
.kpi-card{
    padding:22px;
    border-radius:18px;
    background:#fff;
    border:1px solid var(--mpi-border);
}
.kpi-card small{color:#6b7280; font-weight:600;}
.kpi-card h3{font-weight:800; margin:8px 0 0;}
.table thead th{
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:#6b7280;
}
.badge-soft-success{background:#DCFCE7;color:#166534;}
.badge-soft-warning{background:#FEF3C7;color:#92400E;}
.badge-soft-danger{background:#FEE2E2;color:#991B1B;}
.badge-soft-info{background:#DBEAFE;color:#1E40AF;}
.badge-soft-primary{background:#EDE9FE;color:#4F46E5;}
.badge-soft-secondary{background:#F1F5F9;color:#475569;}
.form-label{font-weight:600; font-size:13px;}
.required::after{content:" *"; color:#dc3545;}
.wizard-step{
    display:flex; align-items:center; gap:10px; padding:12px 14px;
    border-radius:14px; background:#f8fafc; border:1px solid var(--mpi-border);
}
.wizard-step.active{background:#eef6ff; border-color:#93c5fd;}
.step-number{
    width:28px;height:28px;border-radius:50%;display:grid;place-items:center;
    background:#243B6B;color:#fff;font-weight:700;font-size:13px;
}
.map-preview{
    height:420px;
    background:linear-gradient(135deg,#e0f2fe,#f8fafc);
    border:1px dashed #94a3b8;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#475569;
}
.action-btns .btn{margin-right:4px;}


/* Mobile responsive admin shell */
.mobile-backdrop{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.55);
    z-index:998;
}
.mobile-backdrop.show{
    display:block;
}
.mobile-menu-btn{
    display:none;
}
.sidebar-close{
    display:none;
    position:absolute;
    top:16px;
    right:16px;
    width:36px;
    height:36px;
    border:0;
    border-radius:12px;
    background:rgba(255,255,255,.12);
    color:#fff;
}
.table-responsive{
    border-radius:16px;
}
.offcanvas.offcanvas-end{
    max-width:100%;
}
@media(max-width:992px){
    body{
        overflow-x:hidden;
    }
    .admin-shell{
        display:block;
        min-height:100vh;
    }
    .sidebar{
        position:fixed;
        width:290px;
        max-width:86%;
        height:100vh;
        top:0;
        left:-310px;
        bottom:auto;
        z-index:1001;
        transition:left .25s ease;
        box-shadow:16px 0 40px rgba(15,23,42,.28);
    }
    .sidebar.show{
        left:0;
    }
    .sidebar-close{
        display:block;
    }
    .sidebar .brand{
        padding-right:60px;
    }
    .main-content{
        margin-left:0;
        width:100%;
    }
    .topbar{
        height:auto;
        min-height:68px;
        padding:14px 16px;
        gap:12px;
        align-items:flex-start;
    }
    .topbar > div:first-child{
        display:flex;
        align-items:center;
        gap:10px;
        min-width:0;
    }
    .topbar h5{
        font-size:17px;
        line-height:1.2;
    }
    .topbar small{
        display:none;
    }
    .topbar > div:last-child{
        gap:6px!important;
        flex-wrap:wrap;
        justify-content:flex-end;
    }
    .topbar .form-select{
        max-width:135px;
    }
    .mobile-menu-btn{
        display:inline-flex;
        align-items:center;
        justify-content:center;
        width:40px;
        height:40px;
        border-radius:12px;
        flex:0 0 auto;
    }
    .page-content{
        padding:18px 14px;
    }
    .kpi-card{
        padding:18px;
    }
    .card{
        border-radius:16px;
    }
    .card-body{
        padding:16px;
    }
    .d-flex.justify-content-between.align-items-center.mb-4{
        align-items:flex-start!important;
        gap:12px;
        flex-direction:column;
    }
    .d-flex.justify-content-between.align-items-center.mb-4 .btn{
        width:100%;
    }
    .table{
        min-width:720px;
    }
    .offcanvas.offcanvas-end{
        width:100%!important;
    }
    .wizard-step{
        padding:10px 12px;
    }
}
@media(max-width:576px){
    .auth-card{
        margin:16px;
        padding:24px;
        border-radius:18px;
    }
    .topbar{
        flex-direction:column;
    }
    .topbar > div:last-child{
        width:100%;
        justify-content:space-between;
    }
    .topbar .form-select{
        flex:1;
        max-width:none;
    }
    .page-content{
        padding:14px 10px;
    }
    h3.fw-bold{
        font-size:21px;
    }
    .btn{
        white-space:normal;
    }
    .kpi-card h3{
        font-size:24px;
    }
}



.wizard-step.border-success{
    background:#f0fdf4;
    border-color:#86efac!important;
}
.wizard-panel .card.bg-light,
.wizard-panel .bg-light{
    background:#f8fafc!important;
}
#submissionSummary th{
    width:190px;
    color:#64748b;
}


#rowsCanvas .offcanvas-body{
    background:#f8fafc;
}
#rowsCanvas .table{
    background:#fff;
}
#validationRowsTable{
    min-width:1050px;
}
#validationQueueTable{
    min-width:900px;
}
.action-btns .btn{
    margin-bottom:4px;
}


.workflow-pipeline{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}
.workflow-stage{
    flex:1;
    text-align:center;
    padding:16px 10px;
    border-radius:18px;
    background:#f8fafc;
    border:1px solid #e5e7eb;
}
.workflow-stage.active{
    background:#eef6ff;
    border-color:#93c5fd;
}
.stage-icon{
    width:42px;
    height:42px;
    border-radius:14px;
    display:grid;
    place-items:center;
    margin:0 auto 8px;
    background:#243B6B;
    color:#fff;
}
.workflow-line{
    height:3px;
    width:46px;
    background:#cbd5e1;
    border-radius:999px;
}
.timeline{
    position:relative;
}
.timeline-item{
    display:flex;
    gap:14px;
    padding:14px 0;
    border-bottom:1px solid #e5e7eb;
}
.timeline-item:last-child{
    border-bottom:0;
}
.timeline-icon{
    width:38px;
    height:38px;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:#e5e7eb;
    color:#64748b;
    flex:0 0 auto;
}
.timeline-item.done .timeline-icon{
    background:#dcfce7;
    color:#166534;
}
#workflowTable{
    min-width:1000px;
}
@media(max-width:992px){
    .workflow-pipeline{
        flex-direction:column;
        align-items:stretch;
    }
    .workflow-line{
        width:3px;
        height:24px;
        margin:0 auto;
    }
}


#versionTable{
    min-width:1050px;
}
#versionDetailsCanvas .offcanvas-body{
    background:#f8fafc;
}
#changeSummaryChart{
    min-height:280px;
}
#comparisonCard .table{
    min-width:760px;
}


#municipalityTable{
    min-width:1120px;
}
#municipalityCanvas .offcanvas-body,
#municipalityDetailsCanvas .offcanvas-body{
    background:#f8fafc;
}
#municipalityDetailsBox .table th{
    width:170px;
    color:#64748b;
}


#regionTable{
    min-width:1050px;
}
#regionCanvas .offcanvas-body,
#regionDetailsCanvas .offcanvas-body{
    background:#f8fafc;
}
#regionDetailsBox .table th{
    width:170px;
    color:#64748b;
}


#indicatorTable{
    min-width:1120px;
}
#indicatorCanvas .offcanvas-body,
#indicatorDetailsCanvas .offcanvas-body{
    background:#f8fafc;
}
#indicatorDetailsBox .table th{
    width:180px;
    color:#64748b;
}


#gisLayerTable{
    min-width:1060px;
}
#gisLayerCanvas .offcanvas-body,
#gisDetailsCanvas .offcanvas-body{
    background:#f8fafc;
}
.gis-preview-map{
    height:360px;
    border-radius:18px;
    border:1px solid #dbe3ef;
    background:
        linear-gradient(90deg, rgba(148,163,184,.14) 1px, transparent 1px),
        linear-gradient(rgba(148,163,184,.14) 1px, transparent 1px),
        linear-gradient(135deg,#e0f2fe,#f8fafc);
    background-size:32px 32px,32px 32px,100% 100%;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    position:relative;
}
.mock-map-grid{
    position:relative;
    width:100%;
    height:100%;
}
.mock-map-shape{
    position:absolute;
    border:3px solid;
    border-radius:38% 62% 44% 56% / 48% 41% 59% 52%;
    filter:drop-shadow(0 8px 18px rgba(15,23,42,.15));
}
.shape-one{width:190px;height:125px;left:18%;top:20%;transform:rotate(-12deg);}
.shape-two{width:160px;height:140px;right:18%;top:32%;transform:rotate(18deg);}
.shape-three{width:220px;height:115px;left:34%;bottom:18%;transform:rotate(7deg);}
.mock-map-label{
    position:absolute;
    left:20px;
    bottom:20px;
    background:rgba(255,255,255,.94);
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:10px 14px;
    font-weight:700;
    box-shadow:0 10px 25px rgba(15,23,42,.12);
}
#gisDetailsBox .table th{
    width:180px;
    color:#64748b;
}
@media(max-width:576px){
    .gis-preview-map{height:280px;}
}


#usersTable{
    min-width:1120px;
}
#userCanvas .offcanvas-body,
#userDetailsCanvas .offcanvas-body{
    background:#f8fafc;
}
.user-avatar{
    width:38px;
    height:38px;
    border-radius:14px;
    background:#243B6B;
    color:#fff;
    display:grid;
    place-items:center;
    font-weight:800;
    font-size:13px;
    flex:0 0 auto;
}
#userDetailsBox .table th{
    width:160px;
    color:#64748b;
}


.role-card{
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:16px;
    background:#fff;
    cursor:pointer;
    transition:.18s ease;
}
.role-card:hover{
    border-color:#93c5fd;
    box-shadow:0 10px 24px rgba(15,23,42,.08);
}
.selected-role-card{
    border-color:#243B6B;
    background:#eef6ff;
}
#permissionsTable{
    min-width:880px;
}
#permissionsTable .form-switch{
    display:flex;
    justify-content:center;
}
#roleCanvas .offcanvas-body,
#roleDetailsCanvas .offcanvas-body{
    background:#f8fafc;
}
#roleDetailsBox .table th{
    width:160px;
    color:#64748b;
}


#auditTable{
    min-width:1080px;
}
#auditDetailsCanvas .offcanvas-body{
    background:#f8fafc;
}
#auditDetailsBox .table th{
    width:150px;
    color:#64748b;
}
.audit-json{
    background:#0f172a;
    color:#e5e7eb;
    padding:16px;
    border-radius:14px;
    min-height:160px;
    max-height:320px;
    overflow:auto;
    font-size:12px;
}


#exportTable{
    min-width:1120px;
}
#exportDetailsCanvas .offcanvas-body,
#newExportCanvas .offcanvas-body{
    background:#f8fafc;
}
#exportDetailsBox .table th{
    width:160px;
    color:#64748b;
}


#settingsTabs .nav-link{
    border-radius:12px;
}
.maintenance-preview{
    border-radius:18px;
    padding:28px;
    background:linear-gradient(135deg,#152238,#243B6B);
    color:#fff;
    text-align:center;
}
#settingsForm .table{
    min-width:760px;
}


.dashboard-kpi-icon{
    width:48px;
    height:48px;
    border-radius:16px;
    display:grid;
    place-items:center;
    background:#eef6ff;
    color:#243B6B;
    font-size:20px;
}
.health-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:13px 0;
    border-bottom:1px solid #e5e7eb;
}
.health-item:last-child{border-bottom:0;}
.dashboard-list-item{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    padding:13px 0;
    border-bottom:1px solid #e5e7eb;
}
.dashboard-list-item:last-child{border-bottom:0;}
.dashboard-activity-item{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:12px 0;
    border-bottom:1px solid #e5e7eb;
}
.dashboard-activity-item:last-child{border-bottom:0;}
.activity-icon{
    width:36px;
    height:36px;
    border-radius:12px;
    background:#eef6ff;
    color:#243B6B;
    display:grid;
    place-items:center;
    flex:0 0 auto;
}
.mini-stat{
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:14px;
    background:#f8fafc;
}
.mini-stat small{
    display:block;
    color:#64748b;
    font-weight:600;
}
.mini-stat strong{
    font-size:24px;
}
.quick-module-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
}
.quick-module-card{
    display:flex;
    flex-direction:column;
    gap:6px;
    padding:18px;
    border:1px solid #e5e7eb;
    border-radius:18px;
    text-decoration:none;
    color:#1f2937;
    background:#fff;
    transition:.18s ease;
}
.quick-module-card:hover{
    border-color:#93c5fd;
    transform:translateY(-2px);
    box-shadow:0 10px 24px rgba(15,23,42,.08);
}
.quick-module-card i{
    width:42px;
    height:42px;
    border-radius:14px;
    display:grid;
    place-items:center;
    background:#243B6B;
    color:#fff;
    font-size:18px;
}
.quick-module-card small{
    color:#64748b;
}
#priorityTasksTable{
    min-width:800px;
}
@media(max-width:1200px){
    .quick-module-grid{grid-template-columns:repeat(3,1fr);}
}
@media(max-width:768px){
    .quick-module-grid{grid-template-columns:repeat(2,1fr);}
}
@media(max-width:480px){
    .quick-module-grid{grid-template-columns:1fr;}
}

.mpi-language-switcher{min-width:135px;}

/* ===================== Topbar (modern header) ===================== */
.topbar-left{display:flex;align-items:center;gap:12px;min-width:0;}
.topbar-right{display:flex;align-items:center;gap:10px;}
.topbar-subtitle{display:block;}

/* icon button (bell) */
.topbar-icon-btn{
    position:relative;width:40px;height:40px;border-radius:12px;
    border:1px solid var(--mpi-border);background:#fff;color:#475569;
    display:inline-flex;align-items:center;justify-content:center;font-size:16px;
    transition:all .15s;cursor:pointer;
}
.topbar-icon-btn:hover{background:#f4f7fc;color:#243B6B;border-color:#cbd5e1;}
.topbar-badge{
    position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 5px;
    border-radius:9px;background:#dc2626;color:#fff;font-size:11px;font-weight:700;
    display:flex;align-items:center;justify-content:center;border:2px solid #fff;
}

/* notification dropdown panel */
.topbar-notif-menu{width:340px;max-width:92vw;padding:0;border:1px solid var(--mpi-border);
    border-radius:14px;box-shadow:0 16px 40px rgba(15,23,42,.16);overflow:hidden;}
.topbar-notif-head{display:flex;align-items:center;justify-content:space-between;
    padding:12px 16px;border-bottom:1px solid var(--mpi-border);}
.topbar-notif-body{max-height:340px;overflow-y:auto;}
.topbar-notif-empty{text-align:center;color:#64748b;padding:34px 16px;}
.topbar-notif-empty i{font-size:30px;color:#cbd5e1;}
.topbar-notif-foot{padding:10px 16px;border-top:1px solid var(--mpi-border);background:#f8fafc;text-align:center;}

/* user button + menu */
.topbar-user{
    display:flex;align-items:center;gap:10px;padding:5px 10px 5px 5px;
    border:1px solid var(--mpi-border);background:#fff;border-radius:40px;
    cursor:pointer;transition:all .15s;max-width:230px;
}
.topbar-user:hover{background:#f4f7fc;border-color:#cbd5e1;}
.topbar-user-meta{flex-direction:column;align-items:flex-start;line-height:1.15;min-width:0;}
.topbar-user-name{font-size:13px;font-weight:700;color:#1f2937;max-width:130px;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.topbar-user-role{font-size:11px;color:#64748b;max-width:130px;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.topbar-user-caret{font-size:11px;color:#94a3b8;}
.topbar-avatar-img{width:34px;height:34px;border-radius:50%;object-fit:cover;flex-shrink:0;
    border:1px solid var(--mpi-border);}
.topbar-avatar-img.lg{width:46px;height:46px;}
.topbar-avatar{
    width:34px;height:34px;border-radius:50%;
    background:linear-gradient(135deg,#243B6B,#3E8EDE);color:#fff;
    display:grid;place-items:center;font-size:13px;font-weight:800;flex-shrink:0;
}
.topbar-avatar.lg{width:46px;height:46px;font-size:16px;}

.topbar-user-menu{width:280px;max-width:92vw;padding:8px;border:1px solid var(--mpi-border);
    border-radius:14px;box-shadow:0 16px 40px rgba(15,23,42,.16);}
.topbar-user-header{display:flex;gap:12px;align-items:center;padding:10px 10px 12px;}
.topbar-user-menu .dropdown-item{border-radius:9px;padding:9px 12px;font-size:14px;}
.topbar-user-menu .dropdown-item:hover{background:#f4f7fc;}
.min-w-0{min-width:0;}

@media(max-width:991px){
    .topbar-user{max-width:none;padding:4px;}
    .topbar-icon-btn{width:38px;height:38px;}
}

/* ===================== My Account page ===================== */
.account-avatar-wrap{position:relative;width:120px;height:120px;margin:0 auto;}
.account-avatar{width:120px;height:120px;border-radius:50%;object-fit:cover;
    border:3px solid #fff;box-shadow:0 6px 20px rgba(15,23,42,.12);}
.account-avatar-initials{width:120px;height:120px;border-radius:50%;
    background:linear-gradient(135deg,#243B6B,#3E8EDE);color:#fff;
    display:grid;place-items:center;font-size:42px;font-weight:800;
    border:3px solid #fff;box-shadow:0 6px 20px rgba(15,23,42,.12);}
.account-avatar-edit{position:absolute;bottom:4px;right:4px;width:36px;height:36px;
    border-radius:50%;background:#243B6B;color:#fff;border:2px solid #fff;
    display:flex;align-items:center;justify-content:center;cursor:pointer;
    box-shadow:0 4px 12px rgba(36,59,107,.3);}
.account-avatar-edit:hover{background:#1a2e54;}
.account-meta-row{display:flex;justify-content:space-between;padding:9px 0;
    border-bottom:1px solid var(--mpi-border);font-size:14px;}
.account-meta-row:last-child{border-bottom:none;}
.account-meta-row .label{color:#64748b;}

/* ===================== Settings page — modern tabs ===================== */
.settings-tabs{display:flex;gap:3px;background:#eef0f5;border:1px solid #e2e5ed;
    border-radius:10px;padding:5px;}
.settings-tab-btn{flex:1;border:none;background:transparent;border-radius:7px;
    padding:10px 14px;font-size:13.5px;font-weight:500;color:#64748b;cursor:pointer;
    transition:all .18s ease;display:flex;align-items:center;justify-content:center;
    gap:7px;white-space:nowrap;line-height:1.3;outline:none;}
.settings-tab-btn:hover:not(.active){color:#1e3a5f;background:rgba(255,255,255,.55);}
.settings-tab-btn.active{background:#ffffff;color:#1e3a5f;font-weight:600;
    box-shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06);}
.settings-tab-btn .tab-pill{font-size:11px;font-weight:700;padding:1px 7px;
    border-radius:20px;background:#dde1ea;color:#64748b;transition:all .18s ease;}
.settings-tab-btn.active .tab-pill{background:#dbeafe;color:#1d4ed8;}
.settings-tab-btn .tab-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0;margin-left:-2px;}
.settings-pane{display:none;}
.offcanvas-footer{flex-shrink:0;padding:14px 20px;border-top:1px solid #dee2e6;
    display:flex;gap:8px;justify-content:flex-end;background:#fff;}
