﻿/* ================================================================
   dash2plano.css
   CSS do Dashboard 2º Plano de Ação — Governo Aberto Osasco
   Arquivo externo puro: sem Razor, @media funciona normalmente.
   Caminho sugerido: ~/Content/css/dash2plano.css
   ================================================================ */

/* ── WRAPPER FULL-WIDTH ──────────────────────────────────────────
   Quebra o container-fluid do _Layout para o dashboard ocupar
   100% da viewport.
───────────────────────────────────────────────────────────────── */
.dash-fullwidth-wrapper {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    overflow-x: hidden;
}

/* ── VARIÁVEIS DO DASHBOARD ──────────────────────────────────────*/
#dash2plano-root {
    --navy: #1A0A3A;
    --navy-mid: #2D1260;
    --blue: #6B21C8;
    --blue-light: #7C3AED;
    --accent: #E8507A;
    --accent2: #26A69A;
    --red: #C62828;
    --amber: #F57F17;
    --green: #2E7D32;
    --white: #F7F9FC;
    --gray-100: #EEF2F7;
    --gray-200: #D8E2EE;
    --gray-400: #8A9BBC;
    --gray-600: #4A5E7A;
    --shadow: 0 4px 24px rgba(26,10,58,.15);
    --radius: 12px;
    /* light theme */
    --bg: #F5F3FA;
    --bg2: #EDE9F6;
    --surface: rgba(255,255,255,.9);
    --surface-hover: rgba(255,255,255,1);
    --border: rgba(107,33,200,.1);
    --border-hover: rgba(232,80,122,.45);
    --text-main: #0D1B2E;
    --text-muted: #5A4E7A;
    --text-strong: #1A0A3A;
    --nav-bg: rgba(245,243,250,.97);
    --nav-mobile-bg: rgba(245,243,250,.99);
    --hero-bg1: #3B0764;
    --hero-bg2: #5B21B6;
    --hero-bg3: #7C3AED;
    --chart-grid: rgba(26,10,58,.07);
    --chart-tick: #5A4E7A;
    /* ── RESET COMPLETO DE HERANÇA DO BOOTSTRAP/METRONIC ───────────
       font-size base do site (Metronic) é 13px. Definimos 16px aqui
       como âncora para todos os rem do dashboard.
    ─────────────────────────────────────────────────────────────── */
    font-size: 16px !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text-main);
    transition: background .3s, color .3s;
    box-sizing: border-box;
}

    /* dark theme */
    #dash2plano-root.dash-dark {
        --bg: #1A0A3A;
        --bg2: #120728;
        --surface: rgba(26,10,58,.07);
        --surface-hover: rgba(255,255,255,.09);
        --border: rgba(255,255,255,.1);
        --border-hover: rgba(232,80,122,.4);
        --text-main: #F7F9FC;
        --text-muted: #A89BC8;
        --text-strong: #F7F9FC;
        --nav-bg: rgba(26,10,58,.97);
        --nav-mobile-bg: rgba(26,10,58,.98);
        --hero-bg1: #1A0A3A;
        --hero-bg2: #2D1260;
        --hero-bg3: #4C1D95;
        --chart-grid: rgba(255,255,255,.06);
        --chart-tick: #A89BC8;
    }

    /* ── RESET EM TODOS OS FILHOS ────────────────────────────────────
   Força font-size:1rem em cada descendente, quebrando o valor
   herdado de 13px do body do Bootstrap/Metronic.
   1rem aqui = 16px do #dash2plano-root (não do body do site).
───────────────────────────────────────────────────────────────── */
    #dash2plano-root *,
    #dash2plano-root *::before,
    #dash2plano-root *::after {
        box-sizing: border-box;
        font-family: 'IBM Plex Sans', sans-serif;
        font-size: 1em;
        line-height: 1.5;
    }

/* ── NAV ─────────────────────────────────────────────────────────*/
#dash-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(232,80,122,.35);
    padding: 0 1.5rem;
    transition: background .3s;
}

    #dash-nav .nav-inner {
        max-width: 1280px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        gap: 1rem;
        height: 62px;
        flex-wrap: wrap;
    }

    #dash-nav .nav-brand {
        display: flex;
        align-items: center;
        gap: .7rem;
        flex-shrink: 0;
    }

        #dash-nav .nav-brand .escudo {
            width: 36px;
            height: 36px;
            background: var(--accent);
            border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: .8em !important;
            font-weight: 700;
            color: var(--navy);
        }

        #dash-nav .nav-brand span {
            font-family: 'Playfair Display', serif !important;
            font-size: 1.15em !important;
            font-weight: 700;
            line-height: 1.1;
            color: var(--text-strong);
        }

        #dash-nav .nav-brand small {
            font-size: .75em !important;
            font-weight: 500;
            color: var(--text-muted);
            display: block;
        }

    #dash-nav ul {
        list-style: none;
        display: flex;
        gap: .25rem;
        margin-left: auto;
        flex-wrap: wrap;
        padding: 0 !important;
        margin-bottom: 0 !important;
    }

        #dash-nav ul a {
            display: block;
            padding: .4rem .75rem;
            color: var(--text-muted);
            text-decoration: none;
            font-size: .78em !important;
            font-weight: 500;
            border-radius: 6px;
            transition: all .2s;
            white-space: nowrap;
        }

            #dash-nav ul a:hover {
                color: var(--accent);
                background: rgba(232,80,122,.1);
            }

/* ── HERO ────────────────────────────────────────────────────────*/
#dash-hero {
    background: linear-gradient(135deg, var(--hero-bg1) 0%, var(--hero-bg2) 60%, var(--hero-bg3) 100%);
    position: relative;
    overflow: hidden;
    transition: background .3s;
}

    #dash-hero::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(to bottom right, transparent 49%, var(--bg) 50%);
    }

#dash2plano-root .hero-content {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 4rem 2rem 5rem;
}

#dash2plano-root .badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: #FFFFFF;
    padding: .35rem 1rem;
    border-radius: 999px;
    font-size: 1.0em !important;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

    #dash2plano-root .badge::before {
        content: '●';
        font-size: .5em !important;
        animation: dashPulse 2s infinite;
    }

@keyframes dashPulse {
    0%,100% {
        opacity: 1
    }

    50% {
        opacity: .3
    }
}

#dash2plano-root .dash-h1 {
    font-family: 'Playfair Display', serif !important;
    font-size: clamp(32px, 5vw, 56px) !important;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #FFFFFF;
    padding: 0;
    border: none;
    background: none;
}

    #dash2plano-root .dash-h1 em {
        color: var(--accent);
        font-style: normal;
    }

#dash2plano-root .hero-meta {
    color: rgba(255,255,255,.75);
    font-size: 1.2em !important;
    margin-bottom: 2.5rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

#dash2plano-root .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

#dash2plano-root .kpi {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: transform .2s, background .3s;
}

    #dash2plano-root .kpi:hover {
        transform: translateY(-3px);
    }

#dash2plano-root .kpi-val {
    font-family: 'Playfair Display', serif !important;
    font-size: 2.5em !important;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1;
}

#dash2plano-root .kpi-label {
    color: rgba(255,255,255,.8);
    font-size: 0.9em !important;
    margin-top: .35rem;
    line-height: 1.3;
}

/* ── SECTIONS ────────────────────────────────────────────────────*/
#dash2plano-root section {
    padding: 4rem 2rem;
}

#dash2plano-root .section-inner {
    max-width: 1280px;
    margin: 0 auto;
}

#dash2plano-root .section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

    #dash2plano-root .section-header h2 {
        font-family: 'Playfair Display', serif !important;
        font-size: 1.7em !important;
        font-weight: 700;
        color: var(--text-strong);
    }

    #dash2plano-root .section-header .num {
        font-family: 'IBM Plex Mono', monospace !important;
        font-size: .9em !important;
        color: var(--accent);
        border: 1px solid var(--accent);
        padding: .15rem .5rem;
        border-radius: 4px;
    }

/* ── CARD / CHART-WRAP ───────────────────────────────────────────*/
#dash2plano-root .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all .25s;
}

    #dash2plano-root .card:hover {
        border-color: var(--border-hover);
        background: var(--surface-hover);
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(0,0,0,.25);
    }

    #dash2plano-root .card h3 {
        font-size: 1.0em !important;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 1rem;
    }

#dash2plano-root .chart-wrap {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all .25s;
}

    #dash2plano-root .chart-wrap:hover {
        border-color: var(--border-hover);
        background: var(--surface-hover);
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(0,0,0,.15);
    }

    #dash2plano-root .chart-wrap h3 {
        font-size: 1.0em !important;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 1.25rem;
    }

/* ── RANKING TOP 5 ───────────────────────────────────────────────*/
#dash-demanda {
    background: var(--bg);
    transition: background .3s;
}

#dash2plano-root .top5-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    #dash2plano-root .top5-grid {
        grid-template-columns: 1fr;
    }
}

#dash2plano-root .rank-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

#dash2plano-root .rank-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: all .2s;
    position: relative;
    overflow: hidden;
}

    #dash2plano-root .rank-item:hover {
        border-color: rgba(232,80,122,.4);
        transform: translateX(4px);
    }

    #dash2plano-root .rank-item .fill-bar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        background: linear-gradient(90deg, rgba(232,80,122,.12), transparent);
        transition: width .8s cubic-bezier(.4,0,.2,1);
    }

#dash2plano-root .rank-pos {
    font-family: 'Playfair Display', serif !important;
    font-size: 2.6em !important;
    font-weight: 900;
    min-width: 36px;
    text-align: center;
    position: relative;
    z-index: 1;
}

    #dash2plano-root .rank-pos.gold {
        color: #D946EF;
    }

    #dash2plano-root .rank-pos.silver {
        color: #C0C0C0;
    }

    #dash2plano-root .rank-pos.bronze {
        color: #CD7F32;
    }

    #dash2plano-root .rank-pos.fourth,
    #dash2plano-root .rank-pos.fifth {
        color: var(--gray-400);
    }

#dash2plano-root .rank-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

    #dash2plano-root .rank-info .tema {
        font-weight: 600;
        font-size: 1.3em !important;
        color: var(--text-strong);
    }

    #dash2plano-root .rank-info .ds-val {
        font-family: 'IBM Plex Mono', monospace !important;
        font-size: 1.0em !important;
        color: var(--accent);
        margin-top: .2rem;
    }

#dash2plano-root .rank-bar-outer {
    width: 80px;
    height: 6px;
    background: rgba(255,255,255,.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

#dash2plano-root .rank-bar-inner {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 1s;
}

/* ── SEMÁFORO ────────────────────────────────────────────────────*/
#dash2plano-root .sem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

#dash2plano-root .sem-card {
    border-radius: var(--radius);
    padding: 1.5rem;
    border-width: 1px;
    border-style: solid;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

    #dash2plano-root .sem-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 28px rgba(0,0,0,.15);
    }

    #dash2plano-root .sem-card.alta {
        background: rgba(198,40,40,.08);
        border-color: rgba(198,40,40,.4);
    }

    #dash2plano-root .sem-card.media {
        background: rgba(245,127,23,.08);
        border-color: rgba(245,127,23,.4);
    }

    #dash2plano-root .sem-card.baixa {
        background: rgba(46,125,50,.08);
        border-color: rgba(46,125,50,.4);
    }

#dash2plano-root .sem-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

#dash2plano-root .sem-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
    flex-shrink: 0;
}

#dash2plano-root .alta .sem-dot {
    background: var(--red);
    color: var(--red);
}

#dash2plano-root .media .sem-dot {
    background: var(--amber);
    color: var(--amber);
}

#dash2plano-root .baixa .sem-dot {
    background: var(--green);
    color: var(--green);
}

#dash2plano-root .sem-title {
    font-weight: 700;
    font-size: 1.3em !important;
}

#dash2plano-root .alta .sem-title {
    color: #EF5350;
}

#dash2plano-root .media .sem-title {
    color: #FFB74D;
}

#dash2plano-root .baixa .sem-title {
    color: #66BB6A;
}

#dash2plano-root .sem-range {
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: .9em !important;
    color: var(--gray-400);
    margin-left: auto;
}

#dash2plano-root .sem-items {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

#dash2plano-root .sem-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.0em !important;
    padding: .5rem .75rem;
    background: var(--surface);
    border-radius: 6px;
    color: var(--text-main);
}

    #dash2plano-root .sem-item .pct {
        font-family: 'IBM Plex Mono', monospace !important;
        font-size: 1.0em !important;
        font-weight: 600;
    }

#dash2plano-root .alta .sem-item .pct {
    color: #EF5350;
}

#dash2plano-root .media .sem-item .pct {
    color: #FFB74D;
}

#dash2plano-root .baixa .sem-item .pct {
    color: #66BB6A;
}

/* ── TWO-COL ─────────────────────────────────────────────────────*/
#dash2plano-root .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    #dash2plano-root .two-col {
        grid-template-columns: 1fr;
    }
}

/* ── FONTES ──────────────────────────────────────────────────────*/
#dash-fontes {
    background: var(--bg);
    transition: background .3s;
}

#dash2plano-root .fonte-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: .75rem;
}

#dash2plano-root .fonte-label {
    font-size: .82em !important;
    min-width: 200px;
    color: var(--text-main);
}

@media (max-width: 600px) {
    #dash2plano-root .fonte-label {
        min-width: 120px;
        font-size: .72em !important;
    }
}

#dash2plano-root .fonte-track {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

#dash2plano-root .fonte-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--blue-light), var(--accent2));
    transition: width 1s;
}

#dash2plano-root .fonte-val {
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: .75em !important;
    color: var(--accent);
    min-width: 40px;
    text-align: right;
}

/* ── ODS ─────────────────────────────────────────────────────────*/
#dash2plano-root .ods-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    margin-top: .5rem;
}

#dash2plano-root .ods-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .9rem .6rem;
    transition: all .22s;
    gap: .35rem;
}

    #dash2plano-root .ods-tag:hover {
        background: var(--surface-hover);
        border-color: var(--border-hover);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,.15);
    }

    #dash2plano-root .ods-tag .ods-num {
        font-family: 'IBM Plex Mono', monospace !important;
        font-size: .82em !important;
        font-weight: 700;
        color: var(--accent);
    }

    #dash2plano-root .ods-tag .ods-name {
        font-size: .7em !important;
        font-weight: 500;
        color: var(--text-muted);
        line-height: 1.3;
    }

/* ── COMPROMISSOS ────────────────────────────────────────────────*/
#dash2plano-root .comp-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1rem;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: .6rem;
    border-left: 3px solid var(--accent);
    transition: background .2s;
}

    #dash2plano-root .comp-stat:hover {
        background: var(--surface-hover);
    }

    #dash2plano-root .comp-stat.verde {
        border-left-color: #26A69A;
    }

    #dash2plano-root .comp-stat.vermelho {
        border-left-color: #EF5350;
    }

    #dash2plano-root .comp-stat.azul {
        border-left-color: #1976D2;
    }

    #dash2plano-root .comp-stat .cs-val {
        font-family: 'Playfair Display', serif !important;
        font-size: 1.7em !important;
        font-weight: 900;
        min-width: 60px;
        text-align: center;
        line-height: 1;
    }

    #dash2plano-root .comp-stat.verde .cs-val {
        color: #26A69A;
    }

    #dash2plano-root .comp-stat.vermelho .cs-val {
        color: #EF5350;
    }

    #dash2plano-root .comp-stat.azul .cs-val {
        color: #1976D2;
    }

    #dash2plano-root .comp-stat .cs-desc {
        font-size: 1.0em !important;
        line-height: 1.4;
        color: var(--text-muted);
    }

        #dash2plano-root .comp-stat .cs-desc strong {
            color: var(--text-strong);
            font-weight: 600;
        }

/* ── THEME TOGGLE ────────────────────────────────────────────────*/
#themeIcon {
    filter: grayscale(1) brightness(0);
}

#dash2plano-root.dash-dark #themeIcon {
    filter: none;
}

#dash2plano-root .theme-toggle {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .3rem .7rem .3rem .5rem;
    cursor: pointer;
    font-size: .75em !important;
    font-weight: 500;
    color: var(--text-muted);
    transition: all .2s;
    flex-shrink: 0;
}

    #dash2plano-root .theme-toggle:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

/* ── HAMBURGER ───────────────────────────────────────────────────*/
#dash2plano-root .hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.4em !important;
    margin-left: auto;
}

@media (max-width: 900px) {
    #dash2plano-root .hamburger {
        display: block;
    }

    #dash-nav ul {
        display: none;
        position: fixed;
        top: 62px;
        left: 0;
        right: 0;
        background: var(--nav-mobile-bg);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid rgba(232,80,122,.2);
        gap: .25rem;
    }

        #dash-nav ul.open {
            display: flex;
        }

        #dash-nav ul a {
            padding: .75rem 1rem;
            font-size: .9em !important;
        }

    #dash2plano-root .theme-toggle #themeLabel {
        display: none;
    }

    #dash2plano-root .theme-toggle {
        padding: .3rem .5rem;
    }
}

@media (max-width: 600px) {
    #dash2plano-root .kpi-val {
        font-size: 2em !important;
    }

    #dash2plano-root .dash-h1 {
        font-size: 1.8em !important;
    }

    #dash2plano-root section {
        padding: 3rem 1rem;
    }
}

/* ── SCROLL TOP ──────────────────────────────────────────────────*/
#dashScrollTop {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--accent);
    color: var(--navy);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2em !important;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
    transition: all .2s;
    z-index: 998;
}

    #dashScrollTop.visible {
        display: flex;
    }

    #dashScrollTop:hover {
        transform: scale(1.1);
    }

/* ── DIVIDER ─────────────────────────────────────────────────────*/
#dash2plano-root .dash-divider {
    height: 1px;
    background: var(--border);
    margin: 0 2rem;
    transition: background .3s;
}

/* ── FOOTER ──────────────────────────────────────────────────────*/
#dash2plano-root .dash-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .78em !important;
    transition: border-color .3s;
}

    #dash2plano-root .dash-footer span {
        color: var(--accent);
    }

/* ── TABLE ───────────────────────────────────────────────────────*/
#tabelaDetalhamento th,
#tabelaDetalhamento td {
    vertical-align: middle;
}

@media (max-width: 600px) {
    #tabelaDetalhamento {
        font-size: .72em !important;
    }

        #tabelaDetalhamento th,
        #tabelaDetalhamento td {
            padding: .5rem .6rem;
        }
}