/* ============================================================
   DASHBOARD PROJECT
   ============================================================ */

:root {
    --project-bg: #07111f;
    --project-bg-soft: #0b1628;

    --project-blue: #2864e8;
    --project-blue-dark: #173f91;
    --project-blue-light: #376fe5;

    --project-text: #ffffff;
    --project-text-soft: #a8b9d4;
    --project-border: rgba(255, 255, 255, 0.12);

    --project-green: #27c96f;
    --project-yellow: #f5b82e;
    --project-purple: #7445ef;
    --project-gray: #71839f;
}


/* ============================================================
   ROOT
   ============================================================ */

.pie-dashboard {
    width: 100%;
    min-height: 100vh;

    background: var(--project-bg);

    color: var(--project-text);
}

.pie-dashboard .container-fluid {
    width: 100%;
    max-width: 1600px;

    margin: 0 auto;

    padding-left: 24px !important;
    padding-right: 24px !important;
}


/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
    width: 100%;

    min-height: 90px;

    margin-bottom: 18px;

    display: grid;

    grid-template-columns:
        minmax(260px, 1fr)
        minmax(280px, 1.4fr)
        minmax(300px, 1.5fr);

    align-items: center;

    gap: 24px;

    padding: 16px 24px;

    border-radius: 18px;

    background: #0c1728;

    border: 1px solid var(--project-border);
}


/* ============================================================
   BRAND
   ============================================================ */

.brand {
    display: flex;

    align-items: center;

    gap: 14px;

    min-width: 0;
}

.brand-logo {
    width: 56px;
    height: 56px;

    flex: 0 0 56px;

    border-radius: 16px;

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

    background: var(--project-blue);

    color: #ffffff;

    font-size: 22px;
    font-weight: 800;
}

.brand-text {
    min-width: 0;
}

.brand-text h2 {
    margin: 0;

    color: #ffffff;

    font-size: 22px;
    font-weight: 700;

    line-height: 1.2;
}

.brand-text span {
    display: block;

    margin-top: 3px;

    color: var(--project-text-soft);

    font-size: 14px;
}


/* ============================================================
   PAGE TITLE
   ============================================================ */

.page-title {
    min-width: 0;
}

.page-title h1 {
    margin: 0;

    color: #ffffff;

    font-size: 28px;
    font-weight: 700;

    line-height: 1.1;
}

.page-title span {
    display: block;

    margin-top: 5px;

    color: var(--project-text-soft);

    font-size: 14px;
}


/* ============================================================
   HEADER SEARCH
   ============================================================ */

.topbar-search {
    width: 100%;

    height: 52px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 18px;

    border-radius: 15px;

    background: #07111f;

    border: 1px solid rgba(255, 255, 255, 0.13);
}

.topbar-search i {
    color: #91a6c5;

    font-size: 18px;
}

.topbar-search input {
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;

    color: #ffffff;

    font-size: 15px;
}

.topbar-search input::placeholder {
    color: #7f93b1;
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.navigation-section {
    width: 100%;

    margin-bottom: 24px;

    overflow: hidden;
}

.dashboard-navigation {
    width: 100%;

    min-height: 72px;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 8px;

    border-radius: 22px;

    background: #ffffff;

    overflow-x: auto;

    scrollbar-width: thin;
}

.dashboard-navigation::-webkit-scrollbar {
    height: 5px;
}

.dashboard-navigation::-webkit-scrollbar-thumb {
    background: #c4ccda;

    border-radius: 20px;
}

.dashboard-navigation a,
.dashboard-navigation button {
    flex: 0 0 auto;

    height: 56px;

    padding: 0 28px;

    border: 0;

    border-radius: 17px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    background: transparent;

    color: #60728e;

    text-decoration: none;

    font-size: 15px;

    font-weight: 600;

    white-space: nowrap;

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

.dashboard-navigation a:hover,
.dashboard-navigation button:hover {
    color: var(--project-blue);
}

.dashboard-navigation .active {
    background: var(--project-blue);

    color: #ffffff;

    box-shadow:
        0 8px 20px rgba(40, 100, 232, 0.22);
}


/* ============================================================
   FILTER CARD
   ============================================================ */

.dashboard-filter-card {
    width: 100%;

    margin-bottom: 28px;

    padding: 30px 34px;

    border-radius: 28px;

    background:
        linear-gradient(
            135deg,
            #214fae 0%,
            #3869db 100%
        );

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.18);

    overflow: hidden;
}


/* ============================================================
   FILTER TITLE
   ============================================================ */

.filter-title {
    width: 100%;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 24px;

    margin-bottom: 28px;
}

.filter-title-left {
    min-width: 0;
}

.filter-title h1 {
    margin: 0;

    display: flex;

    align-items: center;

    gap: 12px;

    color: #ffffff;

    font-size: 34px;

    font-weight: 700;

    line-height: 1.1;
}

.filter-title h1 i {
    font-size: 32px;
}

.filter-title span {
    display: block;

    margin-top: 7px;

    color: #e1e9fb;

    font-size: 16px;
}


/* ============================================================
   LAST UPDATE
   ============================================================ */

.last-update {
    min-width: 190px;

    text-align: right;
}

.last-update small {
    display: block;

    color: #d8e3fa;

    font-size: 13px;
}

.last-update strong {
    display: block;

    margin-top: 4px;

    color: #ffffff;

    font-size: 17px;

    font-weight: 700;
}


/* ============================================================
   FILTER GRID
   ============================================================ */

.filter-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        1.25fr
        1.25fr
        1fr
        1fr;

    gap: 22px;
}

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

.filter-item label {
    display: block;

    margin-bottom: 8px;

    color: #ffffff;

    font-size: 14px;

    font-weight: 500;
}


/* ============================================================
   DATE RANGE
   ============================================================ */

.date-range {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);

    align-items: center;

    gap: 9px;
}

.date-input {
    min-width: 0;
}

.date-input input,
.filter-item > select,
.filter-item select.form-select {
    width: 100%;

    height: 54px;

    padding: 0 16px;

    border: 0;

    outline: 0;

    border-radius: 15px;

    background: rgba(255, 255, 255, 0.17);

    color: #ffffff;

    font-size: 14px;

    font-weight: 500;

    box-shadow: none;
}

.date-input input:focus,
.filter-item select:focus {
    outline: 2px solid rgba(255, 255, 255, 0.55);

    outline-offset: 1px;
}

.date-input input::-webkit-calendar-picker-indicator {
    cursor: pointer;

    filter: brightness(0) invert(1);

    opacity: 0.95;
}

.filter-item select option {
    color: #1c2a40;

    background: #ffffff;
}

.date-separator {
    color: #ffffff;

    font-size: 17px;

    font-weight: 600;
}


/* ============================================================
   FILTER ACTIONS
   ============================================================ */

.filter-actions {
    margin-top: 22px;

    display: flex;

    justify-content: flex-end;

    align-items: center;

    gap: 14px;
}

.filter-actions .btn {
    min-width: 155px;

    height: 54px;

    padding: 0 22px;

    border: 0;

    border-radius: 15px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 9px;

    color: #ffffff;

    font-size: 15px;

    font-weight: 600;

    cursor: pointer;

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

.filter-actions .btn:hover {
    transform: translateY(-2px);

    opacity: 0.94;
}

.btn-refresh {
    background: #70829d;
}

.btn-export {
    background: #1dc969;
}

.btn-ai {
    background: #7445ef;
}


/* ============================================================
   SECTION TITLE
   ============================================================ */

.section-title {
    margin-bottom: 18px;
}

.section-title h2 {
    margin: 0;

    color: #ffffff;

    font-size: 28px;

    font-weight: 700;

    line-height: 1.2;
}

.section-title span {
    display: block;

    margin-top: 5px;

    color: #8fa2bf;

    font-size: 15px;
}


/* ============================================================
   DIVISION CONTAINER
   ============================================================ */

.division-chart-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 20px;

    align-items: stretch;
}


/* ============================================================
   DIVISION CARD
   ============================================================ */

.division-chart-card {
    position: relative;

    min-width: 0;

    min-height: 420px;

    padding: 22px;

    border-radius: 24px;

    background:
        linear-gradient(
            145deg,
            #183f91 0%,
            #2857ad 100%
        );

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.18);

    color: #ffffff;

    display: flex;

    flex-direction: column;

    overflow: hidden;
}

.division-chart-card::after {
    content: "";

    position: absolute;

    width: 130px;
    height: 130px;

    right: -55px;
    bottom: -55px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.035);

    pointer-events: none;
}


/* ============================================================
   DIVISION CARD HEADER
   ============================================================ */

.division-card-header {
    position: relative;

    z-index: 1;

    width: 100%;

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;
}

.division-card-title {
    min-width: 0;
}

.division-card-kicker {
    display: block;

    margin-bottom: 5px;

    color: #a9c0ef;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 1.6px;

    text-transform: uppercase;
}

.division-card-title h3 {
    margin: 0;

    color: #ffffff;

    font-size: 24px;

    font-weight: 700;

    line-height: 1.2;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.division-card-icon {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        rgba(255, 255, 255, 0.12);

    color: #ffffff;

    font-size: 17px;
}


/* ============================================================
   DIVISION CHART BODY
   ============================================================ */

.division-chart-body {
    position: relative;

    z-index: 1;

    width: 100%;

    height: 215px;

    margin-top: 10px;

    display: flex;

    align-items: center;

    justify-content: center;
}

.division-canvas-wrapper {
    position: relative;

    width: 200px;
    height: 200px;

    flex: 0 0 200px;
}

.division-canvas-wrapper canvas {
    display: block !important;

    width: 200px !important;
    height: 200px !important;

    max-width: 200px !important;
    max-height: 200px !important;
}


/* ============================================================
   DIVISION LEGEND
   ============================================================ */

.division-legend {
    position: relative;

    z-index: 1;

    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;

    margin-top: 2px;
}

.division-legend-item {
    min-width: 0;

    display: flex;

    align-items: center;

    gap: 8px;

    color: #dce6f8;

    font-size: 13px;
}

.division-legend-dot {
    width: 10px;
    height: 10px;

    flex: 0 0 10px;

    border-radius: 50%;
}

.division-legend-label {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ============================================================
   DIVISION VALUES
   ============================================================ */

.division-values {
    position: relative;

    z-index: 1;

    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-top: 15px;
}

.division-value-item {
    min-width: 0;
}

.division-value-label {
    display: block;

    margin-bottom: 4px;

    color: #9fb4d7;

    font-size: 11px;

    font-weight: 500;
}

.division-value-number {
    display: block;

    color: #ffffff;

    font-size: 15px;

    font-weight: 700;

    line-height: 1.2;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* ============================================================
   DIVISION FOOTER
   ============================================================ */

.division-card-footer {
    position: relative;

    z-index: 1;

    width: 100%;

    margin-top: auto;

    padding-top: 14px;

    border-top:
        1px solid rgba(255, 255, 255, 0.13);

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;
}

.division-card-footer span {
    color: #b8c8e3;

    font-size: 13px;
}

.division-card-footer strong {
    color: #ffffff;

    font-size: 17px;

    font-weight: 700;

    white-space: nowrap;
}


/* ============================================================
   EMPTY / LOADING
   ============================================================ */

.division-empty {
    grid-column: 1 / -1;

    min-height: 220px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 22px;

    border:
        1px dashed rgba(255, 255, 255, 0.13);

    background:
        rgba(255, 255, 255, 0.025);

    color: #8ea0bb;

    font-size: 14px;
}


/* ============================================================
   GENERAL PIE DASHBOARD GRID
   ============================================================ */

.pie-dashboard-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 20px;

    margin-top: 28px;
}


/* ============================================================
   GENERIC CHART CARD
   Untuk job-status, revenue-cost, outstanding
   ============================================================ */

.chart-card {
    min-width: 0;

    min-height: 380px;

    padding: 22px;

    border-radius: 24px;

    background:
        linear-gradient(
            145deg,
            #183f91,
            #2857ad
        );

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.18);

    color: #ffffff;
}

.chart-card-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;
}

.chart-card-header h3 {
    margin: 3px 0 0;

    color: #ffffff;

    font-size: 22px;

    font-weight: 700;
}

.chart-card-header > i {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        rgba(255, 255, 255, 0.12);

    color: #ffffff;
}

.card-kicker {
    color: #a9c0ef;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1.4px;

    text-transform: uppercase;
}


/* ============================================================
   GENERIC CHART CONTENT
   ============================================================ */

.chart-content {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(140px, 0.9fr);

    align-items: center;

    gap: 15px;

    margin-top: 15px;
}

.canvas-wrapper {
    position: relative;

    width: 100%;

    height: 205px;
}

.canvas-wrapper canvas {
    display: block !important;

    width: 100% !important;

    height: 100% !important;
}


/* ============================================================
   GENERIC LEGEND
   ============================================================ */

.chart-legend {
    display: flex;

    flex-direction: column;

    gap: 13px;
}

.legend-row {
    display: grid;

    grid-template-columns:
        10px minmax(0, 1fr);

    column-gap: 9px;

    font-size: 13px;
}

.legend-dot {
    width: 10px;
    height: 10px;

    border-radius: 50%;

    margin-top: 4px;
}

.legend-label {
    color: #d9e4fb;
}

.legend-value {
    margin-top: 3px;

    color: #ffffff;

    font-weight: 700;
}

.legend-percent {
    margin-top: 2px;

    color: #a8b9d8;

    font-size: 12px;
}


/* ============================================================
   CHART TOTAL
   ============================================================ */

.chart-total {
    margin-top: 10px;

    padding-top: 12px;

    border-top:
        1px solid rgba(255, 255, 255, 0.12);

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;
}

.chart-total span {
    color: #b9c8e3;

    font-size: 13px;
}

.chart-total strong {
    color: #ffffff;

    font-size: 17px;
}


/* ============================================================
   RESPONSIVE 1400
   ============================================================ */

@media (max-width: 1400px) {

    .pie-dashboard .container-fluid {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .dashboard-filter-card {
        padding: 26px 28px;
    }

    .filter-title h1 {
        font-size: 30px;
    }

    .filter-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .division-chart-grid {
        gap: 18px;
    }

}


/* ============================================================
   RESPONSIVE 1200
   ============================================================ */

@media (max-width: 1200px) {

    .page-header {
        grid-template-columns:
            1fr 1fr;
    }

    .page-title {
        display: none;
    }

    .division-chart-grid,
    .pie-dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* ============================================================
   RESPONSIVE 900
   ============================================================ */

@media (max-width: 900px) {

    .page-header {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-title {
        flex-direction: column;
    }

    .last-update {
        text-align: left;
    }

    .filter-actions {
        justify-content: stretch;

        flex-wrap: wrap;
    }

    .filter-actions .btn {
        flex: 1;
    }

}


/* ============================================================
   RESPONSIVE 768
   ============================================================ */

@media (max-width: 768px) {

    .pie-dashboard .container-fluid {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .dashboard-filter-card {
        padding: 22px 20px;

        border-radius: 22px;
    }

    .filter-title h1 {
        font-size: 27px;
    }

    .filter-title h1 i {
        font-size: 25px;
    }

    .filter-title span {
        font-size: 14px;
    }

    .division-chart-grid,
    .pie-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .division-chart-card {
        min-height: 400px;
    }

    .division-chart-body {
        height: 205px;
    }

    .filter-actions .btn {
        min-width: 0;

        padding: 0 14px;
    }

}


/* ============================================================
   RESPONSIVE 560
   ============================================================ */

@media (max-width: 560px) {

    .date-range {
        grid-template-columns:
            1fr;
    }

    .date-separator {
        display: none;
    }

    .filter-actions {
        display: grid;

        grid-template-columns: 1fr;
    }

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

    .division-chart-card {
        padding: 20px;

        min-height: 390px;
    }

    .division-canvas-wrapper {
        width: 180px;
        height: 180px;

        flex-basis: 180px;
    }

    .division-canvas-wrapper canvas {
        width: 180px !important;
        height: 180px !important;

        max-width: 180px !important;
        max-height: 180px !important;
    }

    .division-chart-body {
        height: 190px;
    }

    .division-values {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   PRINT
   ============================================================ */

@media print {

    .pie-dashboard {
        background: #ffffff;
    }

    .dashboard-filter-card,
    .division-chart-card,
    .chart-card {
        box-shadow: none;
    }

}