:root{

    --coffee-dark:#2c1810;
    --coffee-main:#5c3824;
    --coffee-soft:#8b5a3c;
    --coffee-gold:#c58b55;

    --cream:#f7f1ea;
    --card:#ffffff;

    --text:#2b211b;
    --muted:#7b6d63;
}

/* BODY */

body{

    min-height:100vh;

    background:

        radial-gradient(
            circle at top left,
            rgba(197,139,85,.20),
            transparent 30%
        ),

        radial-gradient(
            circle at bottom right,
            rgba(92,56,36,.12),
            transparent 35%
        ),

        linear-gradient(
            135deg,
            #f8f4ef,
            #efe3d4
        );

    background-attachment:fixed;

    color:var(--text);

    overflow-x:hidden;

    position:relative;
}

/* BLURS DECORATIVOS */

body::before{

    content:"";

    position:fixed;

    width:500px;
    height:500px;

    top:-120px;
    left:-120px;

    background:
        radial-gradient(
            circle,
            rgba(197,139,85,.20),
            transparent 70%
        );

    filter:blur(40px);

    z-index:0;

    pointer-events:none;
}

body::after{

    content:"";

    position:fixed;

    width:450px;
    height:450px;

    bottom:-150px;
    right:-100px;

    background:
        radial-gradient(
            circle,
            rgba(92,56,36,.15),
            transparent 70%
        );

    filter:blur(40px);

    z-index:0;

    pointer-events:none;
}

/* MAIN */

main.container{

    position:relative;
    z-index:2;
}

/* HEADER */

.dashboard-header{

    background:
        linear-gradient(
            135deg,
            rgba(44,24,16,.92),
            rgba(92,56,36,.88)
        );

    backdrop-filter:blur(12px);

    border-radius:32px;

    padding:45px;

    color:white;

    box-shadow:
        0 25px 60px rgba(44,24,16,.20);

    border:
        1px solid rgba(255,255,255,.08);

    overflow:hidden;

    position:relative;
}

.dashboard-header::before{

    content:"";

    position:absolute;

    width:300px;
    height:300px;

    background:
        radial-gradient(
            circle,
            rgba(255,255,255,.08),
            transparent 70%
        );

    top:-120px;
    right:-80px;
}

/* BOTONES */

.btn-coffee{

    background:var(--coffee-gold);

    border:none;

    color:white;

    border-radius:14px;

    padding:12px 22px;

    font-weight:700;

    transition:.25s;
}

.btn-coffee:hover{

    background:#ad7442;

    transform:translateY(-2px);

    color:white;
}

.btn-outline-coffee{

    border:1px solid rgba(255,255,255,.22);

    color:white;

    border-radius:14px;

    padding:12px 22px;

    font-weight:700;

    backdrop-filter:blur(10px);
}

.btn-outline-coffee:hover{

    background:white;

    color:var(--coffee-main);
}

/* KPI */

.kpi-card{

    background:
        rgba(255,255,255,.72);

    backdrop-filter:blur(16px);

    border:none;

    border-radius:28px;

    overflow:hidden;

    box-shadow:
        0 15px 45px rgba(68,42,25,.08);

    transition:.25s ease;

    position:relative;
}

.kpi-card:hover{

    transform:translateY(-5px);

    box-shadow:
        0 22px 55px rgba(68,42,25,.14);
}

.kpi-card::before{

    content:"";

    position:absolute;

    width:140px;
    height:140px;

    background:
        radial-gradient(
            circle,
            rgba(197,139,85,.18),
            transparent 70%
        );

    top:-50px;
    right:-50px;
}

.kpi-card .card-body{

    padding:30px;
}

.kpi-label{

    color:var(--muted);

    font-weight:600;

    margin-bottom:10px;
}

.kpi-value{

    font-size:2.2rem;

    font-weight:800;

    line-height:1.1;

    color:var(--coffee-dark);
}

.kpi-icon{

    width:58px;
    height:58px;

    border-radius:18px;

    background:#f0dfcd;

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

    font-size:1.5rem;
}

/* ANALYTICS */

.analytics-card{

    background:
        rgba(255,255,255,.78);

    backdrop-filter:blur(14px);

    border:none;

    border-radius:30px;

    box-shadow:
        0 18px 45px rgba(68,42,25,.08);
}

.analytics-card .card-body{

    padding:30px;
}

.analytics-title{

    font-weight:800;

    margin-bottom:25px;

    color:var(--coffee-dark);
}

/* TABLE */

.table thead th{

    border:none;

    color:#8a7b70;

    font-size:.82rem;

    text-transform:uppercase;

    letter-spacing:.05em;
}

.table tbody td{

    border-color:#f1e7dc;

    padding:18px 10px;
}

.rank-badge{

    background:#f1dfcd;

    color:var(--coffee-main);

    border-radius:999px;

    padding:7px 14px;

    font-weight:700;
}

/* MAPA */

#nicaraguaMap{

    width:100%;

    height:420px;

    border-radius:24px;

    overflow:hidden;

    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,.04);
}

.map-summary{

    background:#f5eadf;

    border-radius:20px;

    padding:18px 22px;

    margin-bottom:22px;

    color:#5a4333;
}

/* CHART */

canvas{

    max-height:340px;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {

    width: 280px;

    height: 100vh;

    position: fixed;

    top: 0;
    left: 0;

    z-index: 1000;

    overflow-y: auto;

    background:
        linear-gradient(
            180deg,
            #2c1810,
            #5c3824
        );

    color: white;

    padding: 28px 22px;

    box-shadow:
        12px 0 40px rgba(44, 24, 16, .15);

    transition:
        transform .35s cubic-bezier(.4,0,.2,1),
        opacity .25s ease;
}

.sidebar-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 38px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #c58b55;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.sidebar-brand strong {
    display: block;
    font-size: 1.1rem;
}

.sidebar-brand span {
    display: block;
    font-size: .85rem;
    color: #ead7c4;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-menu a {
    color: #f4e8dc;
    text-decoration: none;
    padding: 13px 16px;
    border-radius: 14px;
    font-weight: 600;
    transition: .2s ease;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,.12);
    color: white;
}

.logout-link {
    margin-top: 22px;
    background: rgba(255,255,255,.10);
}

.admin-content {

    margin-left: 280px;

    width: calc(100% - 280px);

    transition:
        margin-left .35s ease,
        width .35s ease,
        padding .35s ease;
}

@media (max-width: 992px) {
    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }

    .admin-content {
        padding: 0 16px;
    }
}

/* =========================
   RESPONSIVE ADMIN LAYOUT
========================= */

@media (max-width: 1200px) {
    .kpi-value {
        font-size: 1.7rem;
    }

    .dashboard-header {
        padding: 34px;
    }
}

@media (max-width: 992px) {
    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        padding: 20px;
        border-radius: 0 0 26px 26px;
    }

    .sidebar-brand {
        margin-bottom: 20px;
    }

    .sidebar-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .sidebar-menu a {
        text-align: center;
        padding: 12px;
        font-size: .95rem;
    }

    .logout-link {
        margin-top: 0;
    }

    .admin-content {
        padding: 0 18px;
    }

    .dashboard-header {
        margin-top: 24px;
    }

    #nicaraguaMap {
    width: 100%;
    height: 620px;
    border-radius: 24px;
    overflow: hidden;
}
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 28px;
        border-radius: 24px;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .dashboard-header p {
        font-size: 1rem !important;
    }

    .dashboard-actions {
        flex-direction: column;
        width: 100%;
    }

    .dashboard-actions .btn {
        width: 100%;
    }

    .kpi-card .card-body {
        padding: 24px;
    }

    .kpi-value {
        font-size: 1.8rem;
    }

    .analytics-card .card-body {
        padding: 22px;
    }

    .analytics-title {
        font-size: 1.25rem;
    }

    .table {
        font-size: .9rem;
    }

    #nicaraguaMap {
        height: 330px;
    }
}

@media (max-width: 576px) {
    .admin-sidebar {
        padding: 18px 14px;
    }

    .sidebar-brand {
        align-items: center;
    }

    .brand-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .sidebar-menu {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: 0 12px;
    }

    .dashboard-header {
        padding: 24px;
        border-radius: 22px;
    }

    .dashboard-header h1 {
        font-size: 1.65rem;
    }

    .kpi-card {
        border-radius: 22px;
    }

    .kpi-card .card-body {
        flex-direction: row;
        gap: 16px;
    }

    .kpi-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .kpi-value {
        font-size: 1.55rem;
    }

    .analytics-card {
        border-radius: 22px;
    }

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

    .map-summary {
        font-size: .92rem;
        padding: 16px;
    }

    #nicaraguaMap {
        height: 300px;
        border-radius: 18px;
    }
}

/* =========================
   SIDEBAR HIDDEN MODE
========================= */

.admin-sidebar {
    transition: transform .3s ease, width .3s ease;
    z-index: 20;
}

.admin-sidebar.hidden-sidebar {
    transform: translateX(-100%);
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-open-btn {
    position: fixed;
    top: 22px;
    left: 22px;
    z-index: 30;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 16px;
    background: #5c3824;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 12px 30px rgba(44, 24, 16, .25);
    display: none;
}

.sidebar-open-btn.show {
    display: grid;
    place-items: center;
}

.admin-layout.sidebar-is-hidden .admin-content {

    margin-left: 0;

    width: 100%;

    padding-left: 42px;
    padding-right: 42px;

    animation: contentExpand .35s ease;
}

.sidebar-toggle {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: .25s ease;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,.22);
    transform: rotate(90deg);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 34px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu a span:first-child {
    width: 26px;
    text-align: center;
    font-size: 1.1rem;
}

.admin-layout {
    transition: all .35s ease;
}

.admin-content {
    transition:
        margin-left .35s ease,
        padding .35s ease,
        width .35s ease,
        transform .35s ease;
}

.admin-sidebar {
    transition:
        transform .35s cubic-bezier(.4, 0, .2, 1),
        opacity .25s ease;
}

.admin-sidebar.hidden-sidebar {
    transform: translateX(-105%);
    opacity: 0;
}

.admin-layout.sidebar-is-hidden .admin-content {
    padding-left: 42px;
    padding-right: 42px;
    animation: contentExpand .35s ease;
}

@keyframes contentExpand {
    from {
        opacity: .75;
        transform: translateX(-18px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-open-btn {
    transition:
        transform .25s ease,
        opacity .25s ease,
        box-shadow .25s ease;
}

.sidebar-open-btn.show {
    animation: floatIn .3s ease;
}

.sidebar-open-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 16px 38px rgba(44, 24, 16, .32);
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateX(-18px) scale(.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}


.page-hero {
    background:
        linear-gradient(
            135deg,
            rgba(44,24,16,.94),
            rgba(92,56,36,.88)
        );
    color: white;
    border-radius: 30px;
    padding: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    box-shadow: 0 22px 50px rgba(44,24,16,.18);
}

.page-hero h1 {
    font-weight: 850;
    margin: 8px 0;
}

.page-hero p {
    margin: 0;
    color: #ead7c4;
}

.page-kicker {
    display: inline-block;
    background: rgba(255,255,255,.12);
    color: #f6e6d3;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}

.mini-stat-card {
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(14px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 40px rgba(68,42,25,.08);
}

.mini-stat-card span {
    display: block;
    color: #7b6d63;
    font-weight: 650;
    margin-bottom: 10px;
}

.mini-stat-card strong {
    font-size: 2rem;
    color: #2c1810;
}

.response-search {
    max-width: 360px;
    border-radius: 14px;
    padding: 12px 16px;
}

.modern-table tbody tr {
    transition: .2s ease;
}

.modern-table tbody tr:hover {
    background: #fbf4ec;
}

.status-pill {
    display: inline-flex;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 750;
}

.status-pill.success {
    background: #e7f6e9;
    color: #237a3b;
}

.status-pill.muted {
    background: #f0ece8;
    color: #75675d;
}

.btn-view {
    background: #f0dfcd;
    color: #5c3824;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 750;
}

.btn-view:hover {
    background: #c58b55;
    color: white;
}

@media (max-width: 768px) {
    .page-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 26px;
    }

    .page-hero .btn {
        width: 100%;
    }

    .response-search {
        max-width: 100%;
    }
}

.analysis-box {
    background: #f8efe6;
    border-radius: 24px;
    padding: 26px;
    color: #4a2d1d;
    border: 1px solid rgba(92,56,36,.08);
}

.analysis-box h4 {
    font-weight: 850;
    color: #2c1810;
    margin-bottom: 12px;
}

.analysis-box p {
    margin-bottom: 10px;
    line-height: 1.7;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.detail-grid div {
    background: rgba(255,255,255,.72);
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(92,56,36,.08);
}

.detail-grid span {
    display: block;
    color: #7b6d63;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.detail-grid strong {
    color: #2c1810;
    font-size: 1.05rem;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.map-legend {
    background: rgba(255,255,255,.88);
    border-radius: 18px;
    padding: 16px 18px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(68,42,25,.08);
}

.map-legend div {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: #4a2d1d;
    font-weight: 600;
}

.map-legend span {
    width: 24px;
    height: 16px;
    border-radius: 5px;
    display: inline-block;
}

.map-wrapper {
    position: relative;
    width: 100%;
}

#nicaraguaMap {
    width: 100%;
    height: 620px;
    border-radius: 24px;
    overflow: hidden;
}

.floating-legend {
    position: absolute;
    top: 26px;
    right: 26px;
    z-index: 500;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: 0 16px 35px rgba(44,24,16,.18);
}

.map-legend strong {
    display: block;
    margin-bottom: 10px;
    color: #2c1810;
}

.map-legend div {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: #4a2d1d;
    font-weight: 600;
}

.map-legend span {
    width: 24px;
    height: 16px;
    border-radius: 5px;
    display: inline-block;
}

@media (max-width: 768px) {
    #nicaraguaMap {
        height: 420px;
    }

    .floating-legend {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 16px;
        width: 100%;
    }
}

/* FIX ADMIN MOBILE */

.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
    }

    .admin-layout {
        display: block;
        width: 100%;
    }

    .admin-content {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 24px 16px !important;
    }

    .admin-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 82% !important;
        max-width: 340px;
        height: 100vh;
        z-index: 2000;
        transform: translateX(-105%);
        border-radius: 0 28px 28px 0;
        transition: transform .3s ease;
    }

    .admin-sidebar:not(.hidden-sidebar) {
        transform: translateX(0);
    }

    .admin-sidebar.hidden-sidebar {
        transform: translateX(-105%) !important;
        opacity: 1 !important;
    }

    .sidebar-open-btn {
        display: grid !important;
        place-items: center;
        position: fixed;
        top: 18px;
        left: 18px;
        z-index: 2100;
        width: 48px;
        height: 48px;
        border: none;
        border-radius: 16px;
        background: #5c3824;
        color: #fff;
        font-size: 1.35rem;
        box-shadow: 0 12px 30px rgba(44,24,16,.25);
    }

    .sidebar-open-btn.show {
        display: grid !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        backdrop-filter: blur(4px);
        z-index: 1500;
    }

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

    .dashboard-header,
    .page-hero {
        margin-top: 54px;
        padding: 26px !important;
        border-radius: 24px;
    }

    .dashboard-header h1,
    .page-hero h1 {
        font-size: 2rem !important;
        line-height: 1.15;
    }

    .dashboard-actions {
        flex-direction: column;
        width: 100%;
    }

    .dashboard-actions .btn,
    .page-hero .btn {
        width: 100%;
    }

    .kpi-card .card-body {
        padding: 24px !important;
    }

    .kpi-value {
        font-size: 1.65rem !important;
    }

    .analytics-card .card-body {
        padding: 22px !important;
    }

    canvas {
        max-height: 280px;
    }

    #nicaraguaMap {
        height: 430px !important;
    }

    .floating-legend {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin-top: 16px;
        width: 100%;
    }
}

.interactive-stat strong
#interactiveAnalysisChart