/* ============================================
   IT Asset Manager - Modern Admin Theme
   ============================================ */

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 60px;
    --border-radius: 10px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
    color: #334155;
    overflow-x: hidden;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ============================================
   Layout Wrapper
   ============================================ */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar Styles
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--dark-color) 0%, #0f172a 100%);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-header .logo i {
    font-size: 1.75rem;
    color: var(--primary-light);
}

.sidebar-toggler {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
}

.sidebar-user {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user .user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
}

.sidebar-user .user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user .user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar-user .user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    list-style: none;
    padding: 15px 0;
}

.sidebar-nav .nav-header {
    padding: 15px 20px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-nav .nav-item {
    margin: 2px 10px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* ============================================
   Top Navbar
   ============================================ */
.top-navbar {
    height: var(--topbar-height);
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 25px;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 999;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.navbar-title {
    flex: 1;
}

.navbar-title h5 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-right .btn-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

/* ============================================
   Page Content
   ============================================ */
.page-content {
    flex: 1;
    padding: 25px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background: #fff;
    margin-bottom: 25px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 20px;
    font-weight: 600;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

/* ============================================
   Stats Cards
   ============================================ */
.stat-card {
    border-radius: var(--border-radius);
    padding: 25px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 15px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
}

/* ============================================
   Tables
   ============================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    padding: 12px 15px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ============================================
   Forms
   ============================================ */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark-color);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    padding: 5px 10px;
    font-weight: 500;
    border-radius: 6px;
}

/* ============================================
   Footer
   ============================================ */
.main-footer {
    background: #fff;
    padding: 15px 25px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: auto;
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary-color);
}

.login-logo h2 {
    margin-top: 15px;
    color: var(--dark-color);
    font-weight: 700;
}

.login-form .form-control {
    height: 50px;
    font-size: 1rem;
}

.login-form .btn-login {
    height: 50px;
    font-size: 1rem;
    font-weight: 600;
}

/* ============================================
   Select2 Custom Styling
   ============================================ */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 42px;
}

/* ============================================
   DataTables Custom
   ============================================ */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    border-radius: 8px;
}

/* ============================================
   Chart Container
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
}

/* ============================================
   Quick Actions
   ============================================ */
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    border-radius: var(--border-radius);
    background: var(--light-color);
    text-decoration: none;
    color: var(--dark-color);
    transition: var(--transition);
    text-align: center;
}

.quick-action:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-5px);
}

.quick-action i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.quick-action span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggler {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .page-content {
        padding: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ============================================
   Asset View Details
   ============================================ */
.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 150px;
    font-weight: 600;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: var(--dark-color);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar, .top-navbar, .main-footer {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
    }
    
    .page-content {
        padding: 0;
    }
}