/* assets/css/style.css - Refined PAK Fleet Management Styles */

:root {
    /* --- Official PAK Brand Palette --- */
    --pak-blue: #1816e7;        
    --pak-red: #CB2127;         
    --pak-silver: #707578;      
    --pak-black: #000000;       
    --pak-light-bg: #F8F9FA;    
    --pak-blue-tint: rgba(24, 22, 231, 0.06); 
    
    /* Brand Gradients */
    --gradient-primary: linear-gradient(135deg, #1816e7 0%, #0d0b9c 100%); 
    --gradient-danger: linear-gradient(135deg, #CB2127 0%, #991318 100%);  
    --gradient-neutral: linear-gradient(135deg, #707578 0%, #4b4e50 100%); 
    --gradient-info: linear-gradient(135deg, #009EDC 0%, #006b94 100%);    
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 8px 25px rgba(24, 22, 231, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* FIX: Prevent body from swallowing page scroll globally, while allowing dashboard layout to breathe */
body {
    font-family: 'Montserrat', 'Calibri', 'Arial', sans-serif; 
    background-color: var(--pak-light-bg);
    color: var(--pak-black);
    min-height: 100vh;
}

/* ============================================
   SIDEBAR STYLES - Fixed Scrolling (Refined)
   ============================================ */
.sidebar {
    height: 100vh;
    background: var(--gradient-primary);
    color: #FFFFFF;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    scroll-behavior: smooth;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--pak-red);
    z-index: 1;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
.sidebar::-webkit-scrollbar-thumb { background: var(--pak-silver); border-radius: 10px; }
.sidebar { scrollbar-width: thin; scrollbar-color: var(--pak-silver) rgba(255, 255, 255, 0.05); }

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #1816e7 0%, #1210b0 100%);
    z-index: 10;
}

.sidebar-profile { margin-bottom: 15px; }
.profile-avatar {
    width: 65px;
    height: 65px;
    background: var(--gradient-neutral); 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}
.profile-avatar:hover { transform: scale(1.05); }
.profile-avatar i { font-size: 30px; color: #FFFFFF; }
.profile-name { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.profile-role { font-size: 0.75rem; color: rgba(255, 255, 255, 0.75); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-header h4 { margin: 8px 0 0; font-size: 1.1rem; font-weight: 700; color: #FFFFFF; }

.sidebar-nav { flex: 1; padding: 15px 12px; }
.sidebar-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 11px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.25s ease;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.9rem;
}
.sidebar-nav a i { width: 22px; font-size: 1.05rem; text-align: center; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; transform: translateX(3px); }
.sidebar-nav a.active { background: #FFFFFF; color: var(--pak-blue); font-weight: 700; box-shadow: var(--shadow-md); }
.sidebar-nav a.active i { color: var(--pak-blue); }

.logout-link {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 15px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    position: sticky;
    bottom: 0;
    background: #0d0b9c;
}
.logout-link:hover { background: var(--pak-red) !important; color: #FFFFFF !important; }

/* ============================================
   MAIN CONTENT STYLES
   ============================================ */
/* FIX: Removed rigid height/overflow restrictions.
   Using calc() on width to safely accommodate sidebar layout without pushing cards off screen. */
.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 30px 40px;
    min-height: 100vh;
    background: var(--pak-light-bg);
}

/* ============================================
   STAT CARDS & COMPONENT LAYERS
   ============================================ */
.stat-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid #E0E0E0;
    margin-bottom: 15px; /* Added for row breathing room */
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--pak-blue);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    background: var(--gradient-primary);
}

.stat-icon i { font-size: 28px; color: #FFFFFF; }
.stat-details h3 { margin: 0; font-size: 26px; font-weight: 700; color: var(--pak-black); }
.stat-details p { margin: 3px 0 0; color: var(--pak-silver); font-size: 12px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.3px; }

.card { border: 1px solid #E5E8ED; border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; background: #FFFFFF; }
.card-header { background: #FFFFFF; border-bottom: 1px solid #E5E8ED; padding: 16px 24px; font-weight: 700; font-size: 0.95rem; color: var(--pak-black); }
.card-header i { margin-right: 6px; color: var(--pak-blue); }

.table th { color: var(--pak-black); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; background: #F4F6F9; border-bottom: 2px solid #E5E8ED; }
.table td { font-size: 13.5px; color: #333333; }
.table tr:hover td { background: var(--pak-blue-tint) !important; }

.badge { padding: 5px 10px; border-radius: 4px; font-weight: 600; font-size: 11px; }
.bg-success { background-color: #2E7D32 !important; } 
.bg-danger { background-color: var(--pak-red) !important; } 
.bg-primary { background-color: var(--pak-blue) !important; }
.bg-secondary { background-color: var(--pak-silver) !important; }

.btn { border-radius: 6px; padding: 8px 18px; font-weight: 600; font-size: 13px; transition: all 0.2s ease; }
.btn-primary { background: var(--pak-blue); border: none; color: #FFFFFF; }
.btn-primary:hover { background: #0d0b9c; transform: translateY(-1px); box-shadow: var(--shadow-hover); }

.form-control, .form-select { border-radius: 6px; border: 1px solid #CED4DA; padding: 10px 14px; }
.form-control:focus, .form-select:focus { border-color: var(--pak-blue); box-shadow: 0 0 0 3px rgba(24, 22, 231, 0.12); }
.form-label { font-weight: 600; color: var(--pak-black); }

@media (max-width: 992px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
}