/* ============================================
   ICT Asset Management System - Custom Styles
   ============================================ */

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #6c83f5;
    --secondary: #6c757d;
    --success: #2ec4b6;
    --info: #4895ef;
    --warning: #ff9f1c;
    --danger: #e63946;
    --dark: #1d3557;
    --light: #f8f9fa;
    --sidebar-bg: #1a1d3a;
    --sidebar-hover: #252850;
    --sidebar-active: #4361ee;
    --body-bg: #f0f2f5;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: #333;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #12142a 100%);
    height: 100vh;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-brand {
    padding: 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand h5 {
    color: #fff;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-brand small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.sidebar-menu {
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.sidebar-menu::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 10px;
}

.sidebar-menu::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu .menu-header {
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px 8px;
    margin-top: 5px;
}

.sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.65);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 400;
    transition: var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-menu .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
    border-left-color: var(--primary-light);
}

.sidebar-menu .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
    border-left-color: #fff;
    font-weight: 500;
}

.sidebar-menu .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

/* --- Main Content Area --- */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: var(--transition);
}

/* --- Top Navbar --- */
.top-navbar {
    background: #fff;
    padding: 0 25px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-navbar .page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.top-navbar .navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-navbar .notification-bell {
    position: relative;
    color: #555;
    font-size: 18px;
    text-decoration: none;
}

.top-navbar .notification-bell .badge {
    position: absolute;
    top: -6px;
    right: -8px;
    font-size: 10px;
    padding: 2px 5px;
}

.top-navbar .user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.top-navbar .user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

/* --- Content Wrapper --- */
.content-wrapper {
    padding: 25px;
}

/* --- Cards --- */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.stat-card {
    padding: 22px;
    border-radius: var(--border-radius);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.stat-card .stat-icon {
    font-size: 28px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #4361ee, #3a86ff);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #2ec4b6, #20a39e);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ff9f1c, #f77f00);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #e63946, #d62828);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #4895ef, #4cc9f0);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #1d3557, #457b9d);
}

/* --- Tables --- */
.table-container {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-container .table-header {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid #e9ecef;
}

.table-container .table-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--dark);
}

.table {
    margin: 0;
    font-size: 13.5px;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px 15px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background: #f8f9ff;
}

/* --- Badges --- */
.badge {
    font-weight: 500;
    font-size: 11.5px;
    padding: 5px 10px;
    border-radius: 20px;
}

/* --- Buttons --- */
.btn {
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* --- Forms --- */
.form-control,
.form-select {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13.5px;
    border: 1.5px solid #dee2e6;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
}

/* --- Search Box --- */
.search-box {
    position: relative;
    max-width: 300px;
}

.search-box input {
    padding-left: 38px;
    border-radius: 20px;
    border: 1.5px solid #e0e0e0;
    font-size: 13px;
    height: 38px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

/* --- Filter Bar --- */
.filter-bar {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

.filter-bar .form-select {
    font-size: 13px;
    height: 38px;
    padding: 5px 12px;
}

/* --- Breadcrumb --- */
.breadcrumb-wrapper {
    margin-bottom: 20px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

/* --- Detail Page --- */
.detail-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.detail-card .detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-card .detail-label {
    width: 180px;
    font-weight: 500;
    color: #666;
    flex-shrink: 0;
    font-size: 13.5px;
}

.detail-card .detail-value {
    color: #333;
    font-size: 13.5px;
}

/* --- Flash Alerts --- */
.alert {
    border-radius: var(--border-radius);
    border: none;
    font-size: 13.5px;
    padding: 14px 20px;
}

/* --- Pagination --- */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    font-size: 13px;
    color: var(--primary);
    border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* --- Modal Customizations --- */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 12px 20px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ccc;
}

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: 50%;
    top: -200px;
    left: -150px;
    z-index: 0;
    animation: float 10s infinite ease-in-out;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background-color: rgba(46, 196, 182, 0.05);
    border-radius: 50%;
    bottom: -100px;
    right: -50px;
    z-index: 0;
    animation: float 15s infinite ease-in-out reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.05);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 35px 30px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card .login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-card .login-icon {
    width: 54px;
    height: 54px;
    background-color: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.15);
}

/* --- Action Buttons Group --- */
.action-btns {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* --- Print Styles --- */
@media print {

    .sidebar,
    .top-navbar,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-wrapper {
        padding: 0 !important;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        max-width: 85vw;
        height: 100vh;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 15px;
    }

    .top-navbar {
        padding: 0 15px;
    }

    .stat-card {
        margin-bottom: 15px;
    }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.stat-card,
.table-container {
    animation: fadeInUp 0.4s ease-out;
}

/* --- Sidebar Collapse Toggle Button --- */
.sidebar-collapse-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    font-size: 14px;
    flex-shrink: 0;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}
.sidebar-collapse-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* --- Collapsed Sidebar (desktop only) --- */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 70px;
        overflow: visible;
    }
    .sidebar.collapsed .sidebar-brand-text,
    .sidebar.collapsed .sidebar-collapse-btn,
    .sidebar.collapsed .menu-header {
        display: none !important;
    }
    .sidebar.collapsed .sidebar-brand {
        justify-content: center;
        padding: 16px 0;
    }
    .sidebar.collapsed .brand-icon {
        margin: 0 auto;
    }
    .sidebar.collapsed .sidebar-menu {
        padding: 8px 0;
    }

    /* Hide text by zeroing font-size on the link, restore on icon */
    .sidebar.collapsed .nav-link {
        font-size: 0;
        color: rgba(255,255,255,0.65);
        padding: 0;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-left: 3px solid transparent;
        position: relative;
    }
    .sidebar.collapsed .nav-link i {
        font-size: 18px;
        width: 70px;
        text-align: center;
        flex-shrink: 0;
    }
    .sidebar.collapsed .nav-link:hover {
        color: #fff;
        background: var(--sidebar-hover);
        border-left-color: var(--primary-light);
    }
    .sidebar.collapsed .nav-link.active {
        color: #fff;
        background: var(--sidebar-active);
        border-left-color: #fff;
    }

    /* Main content offset */
    .main-content.sidebar-collapsed {
        margin-left: 70px;
    }

    /* Tooltip on hover */
    .sidebar.collapsed .nav-link:hover::after {
        content: attr(data-label);
        position: absolute;
        left: 68px;
        top: 50%;
        transform: translateY(-50%);
        background: #1a1d3a;
        color: #fff;
        padding: 6px 14px;
        border-radius: 6px;
        font-size: 12.5px;
        font-weight: 500;
        white-space: nowrap;
        pointer-events: none;
        z-index: 9999;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        letter-spacing: 0;
    }

    /* Small expand handle on right edge */
    .sidebar.collapsed::after {
        content: '\F285';
        font-family: 'bootstrap-icons';
        position: absolute;
        right: -16px;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
        height: 40px;
        background: var(--sidebar-bg);
        border-radius: 0 6px 6px 0;
        z-index: 999;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(255,255,255,0.4);
        font-size: 10px;
        cursor: pointer;
    }
}