/* Truckaurbus Edge Dashboard Styles */

:root {
    --primary: #4e73df;
    --primary-light: rgba(78, 115, 223, 0.1);
    --primary-dark: #2e59d9;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --secondary: #858796;
    --light: #f8f9fc;
    --dark: #5a5c69;
    --white: #fff;
    --gray-100: #f8f9fc;
    --gray-200: #eaecf4;
    --gray-300: #dddfeb;
    --gray-400: #d1d3e2;
    --gray-500: #b7b9cc;
    --gray-600: #858796;
    --gray-700: #6e707e;
    --gray-800: #5a5c69;
    --gray-900: #3a3b45;
    --body-bg: #f8f9fc;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 100px;
    --header-height: 70px;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --transition-speed: 0.3s;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg);
    color: var(--gray-800);
    font-size: 0.85rem;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    transition: all var(--transition-speed);
}

/* Sidebar */
.dashboard-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--white);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: width var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.logo .our {
    color: var(--primary);
}

.logo .square {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--primary);
    margin-left: 3px;
}

.logo-badge {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--gray-700);
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.nav-link i {
    font-size: 1rem;
    min-width: 2rem;
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-item.active .nav-link {
    background-color: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-around;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    color: var(--gray-600);
    font-size: 0.875rem;
    transition: color 0.3s;
}

.sidebar-footer a i {
    margin-right: 0.5rem;
}

.sidebar-footer a:hover {
    color: var(--primary);
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.dashboard-header {
    height: var(--header-height);
    background-color: var(--white);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-600);
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s;
}

.menu-toggle:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.header-right {
    display: flex;
    align-items: center;
}

.date-picker {
    display: flex;
    align-items: center;
    margin-right: 1.5rem;
}

.date-label {
    margin-right: 0.5rem;
    color: var(--gray-600);
}

.date-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background-color: var(--white);
    color: var(--gray-800);
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}

.action-buttons {
    display: flex;
    align-items: center;
}

.btn-export {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s;
    margin-right: 1.5rem;
}

.btn-export i {
    margin-right: 0.5rem;
}

.btn-export:hover {
    background-color: var(--primary-dark);
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
}

.profile-name {
    font-weight: 500;
    margin-right: 0.5rem;
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: 2rem;
}

/* Stat Cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--white);
    margin-right: 1.25rem;
    flex-shrink: 0;
}

.bg-primary {
    background-color: var(--primary);
}

.bg-success {
    background-color: var(--success);
}

.bg-info {
    background-color: var(--info);
}

.bg-warning {
    background-color: var(--warning);
}

.bg-danger {
    background-color: var(--danger);
}

.stat-info {
    flex: 1;
}

.stat-title {
    color: var(--gray-600);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.stat-change i {
    margin-right: 0.25rem;
}

.positive {
    color: var(--success);
}

.negative {
    color: var(--danger);
}

/* Chart Containers */
.chart-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    height: 400px;
    overflow: hidden;
}

.chart-container.large {
    grid-column: span 2;
}

.chart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.chart-actions {
    display: flex;
    align-items: center;
}

.btn-filter {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--light);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    color: var(--gray-700);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-filter i {
    margin-right: 0.5rem;
}

.btn-filter:hover {
    background-color: var(--gray-200);
}

.chart-legend {
    display: flex;
    margin-left: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-left: 1rem;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 0.5rem;
}

.chart-body {
    padding: 1.5rem;
    height: calc(400px - 82px); /* Header height: 82px (padding + border) */
    position: relative;
}

.radar-chart-container {
    padding: 0.5rem;
}

/* Data Section */
.data-section {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.section-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.btn-view-all {
    padding: 0.5rem 1rem;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.btn-view-all:hover {
    background-color: var(--primary-dark);
}

.data-table-container {
    padding: 1rem;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    vertical-align: middle;
}

.model-cell {
    display: flex;
    align-items: center;
}

.model-cell img {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    margin-right: 0.75rem;
    object-fit: cover;
}

.change-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.change-badge.positive {
    background-color: rgba(28, 200, 138, 0.1);
}

.change-badge.negative {
    background-color: rgba(231, 74, 59, 0.1);
}

.rating {
    display: flex;
    align-items: center;
}

.rating i {
    color: var(--warning);
    font-size: 0.9rem;
    margin-right: 0.1rem;
}

.rating span {
    margin-left: 0.5rem;
    font-weight: 600;
}

/* Footer */
.dashboard-footer {
    background-color: var(--white);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
}

.footer-links a {
    margin-left: 1.5rem;
    color: var(--gray-600);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Responsive Sidebar */
.sidebar-collapsed .dashboard-sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .dashboard-main {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .logo-text {
    font-size: 1.4rem;
}

.sidebar-collapsed .logo-badge,
.sidebar-collapsed .nav-link span,
.sidebar-collapsed .sidebar-footer span {
    display: none;
}

.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar-collapsed .sidebar-footer {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.sidebar-collapsed .sidebar-footer a {
    justify-content: center;
}

.sidebar-collapsed .sidebar-footer a i {
    margin-right: 0;
}

/* Media Queries */
@media (max-width: 1200px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .chart-container.large {
        grid-column: auto;
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .sidebar-collapsed .dashboard-sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .sidebar-collapsed .dashboard-main {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .dashboard-header {
        padding: 0 1rem;
    }
    
    .date-picker {
        display: none;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .profile-name {
        display: none;
    }
    
    .btn-export span {
        display: none;
    }
    
    .btn-export {
        padding: 0.5rem;
    }
    
    .btn-export i {
        margin-right: 0;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-actions {
        margin-top: 1rem;
    }
    
    .dashboard-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .footer-links a {
        margin: 0 0.75rem;
    }
}