/* GLOBAL RESET */
* {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f0ee;
    color: #20252a;
}


/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 180px;
    height: 100vh;
    background: #2f3438;
    border-right: 1px solid #444;
    border-bottom: 1px solid #3e4348;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
    color: #f1f1f1;
}

.sidebar-inner {
    padding: 50px 14px 20px;
}

.sidebar-brand {
    margin-bottom: 20px;
    color: #db6128;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
}


/* SIDEBAR NAVIGATION */
.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: block;
    padding: 10px;
    border-radius: 6px;
    color: #6eb6c8;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border 0.15s ease;
}

    .nav-item:hover {
        background: #255258;
        color: #ffffff;
    }

    .nav-item.active {
        padding-left: 7px;
        background: #252d3d;
        border-left: 3px solid #db6128;
        color: #ffffff;
    }


/* APP WRAPPER */
.app {
    min-height: 100vh;
    margin-left: 180px;
    background: #f3f0ee;
}


/* TOP NAVBAR */
.navbar {
    min-height: 60px;
    background: #262a2e;
    border-bottom: 1px solid #3e4348;
}

.navbar-inner {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.navbar-brand {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    color: #db6128;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
}

    .navbar-brand::after {
        content: "";
        width: 100%;
        height: 2px;
        margin-top: 4px;
        background: #db6128;
    }


/* PAGE CONTENT */
.page-content {
    padding: 24px 28px 50px 32px;
}

.dashboard-header {
    margin-bottom: 18px;
    padding: 16px 18px;
    background: #f3f0ee;
    border-left: 3px solid #6eb6c8;
    border-bottom: 3px solid #6eb6c8;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}


/* DASHBOARD LAYOUT */
.dashboard-page {
    width: 100%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: auto auto;
    column-gap: 20px;
    row-gap: 30px;
    align-items: start;
}

.kpi-grid,
.dashboard-grid,
.module-grid {
    display: grid;
    gap: 20px;
}

.kpi-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}


/* CARDS AND PANELS */
.dashboard-panel,
.kpi-card,
.module-card {
    min-width: 0;
    margin-top: 10px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid #cfc6bc;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.10), 0 14px 28px rgba(0, 0, 0, 0.06);
}

    .dashboard-panel > *:first-child,
    .kpi-card > *:first-child,
    .module-card > *:first-child {
        margin-top: 0;
    }

.kpi-card {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-value {
    font-size: 34px;
    font-weight: 700;
}

.kpi-label {
    color: #5e564d;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}


/* TABLET */
@media (max-width: 1000px) {
    .kpi-grid,
    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-page {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}


/* MOBILE */
@media (max-width: 760px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        box-shadow: none;
    }

    .sidebar-inner {
        padding: 14px 16px;
    }

    .sidebar-brand {
        margin-bottom: 12px;
    }

    .sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-item,
    .nav-item.active {
        margin: 0;
        padding: 8px 10px;
        border-left: none;
    }

        .nav-item.active {
            border-bottom: 3px solid #db6128;
        }

    .app {
        margin-left: 0;
    }

    .navbar {
        min-height: 56px;
    }

    .navbar-inner {
        min-height: 56px;
        padding: 10px 16px;
    }

    .page-content {
        padding: 18px 14px 40px;
    }

    .dashboard-header {
        padding: 14px;
    }

    .dashboard-page {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .kpi-grid,
    .dashboard-grid,
    .module-grid {
        grid-column: 1;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .dashboard-panel,
    .kpi-card,
    .module-card {
        width: 100%;
        margin-top: 0;
        padding: 18px;
    }
}
