:root {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #e9ecef;
    --bs-border-color: #495057;
    --bs-card-bg: #2d3748;
    --bs-primary: #0d6efd;
    --bs-success: #198754;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-info: #0dcaf0;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.card {
    background-color: var(--bs-card-bg);
    border-color: var(--bs-border-color);
    border-radius: 0.5rem;
}

.table {
    color: var(--bs-body-color);
    margin-bottom: 0;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.table thead th {
    border-bottom-color: var(--bs-border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    vertical-align: middle;
    border-top-color: var(--bs-border-color);
}

.form-control, .form-select {
    background-color: #374151;
    border-color: #4b5563;
    color: var(--bs-body-color);
    border-radius: 0.375rem;
}

.form-control:focus, .form-select:focus {
    background-color: #4b5563;
    border-color: var(--bs-primary);
    color: var(--bs-body-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.dropdown-menu {
    background-color: #2d3748;
    border-color: #4b5563;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    color: #e9ecef;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #4b5563;
    color: #fff;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
}

.nav-link.active {
    color: var(--bs-primary) !important;
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-group .btn {
    border-radius: 0.375rem;
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

.badge.bg-success { background-color: var(--bs-success) !important; }
.badge.bg-warning { background-color: var(--bs-warning) !important; color: #000; }
.badge.bg-danger { background-color: var(--bs-danger) !important; }
.badge.bg-info { background-color: var(--bs-info) !important; }
.badge.bg-secondary { background-color: #6c757d !important; }

.modal-content {
    background-color: var(--bs-card-bg);
    border-color: var(--bs-border-color);
}

.modal-header {
    border-bottom-color: var(--bs-border-color);
}

.modal-footer {
    border-top-color: var(--bs-border-color);
}

.alert {
    border-radius: 0.5rem;
    border: none;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.2);
    color: #75b798;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    color: #ea868f;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffda6a;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.2);
    color: #6edff6;
}

.timeline {
    border-left: 2px solid #4b5563;
    padding-left: 1rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: -1.4rem;
    top: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    background-color: var(--bs-primary);
    border-radius: 50%;
    border: 2px solid var(--bs-card-bg);
}

.stat-card {
    transition: transform 0.2s;
    border-radius: 0.5rem;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #2d3748;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        background-color: white !important;
    }
    
    .table {
        color: black !important;
    }
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Animation for status changes */
.status-change {
    animation: statusChange 0.5s ease-in-out;
}

@keyframes statusChange {
    0% { background-color: transparent; }
    50% { background-color: rgba(13, 110, 253, 0.2); }
    100% { background-color: transparent; }
}

/* Tooltip styles */
.tooltip-inner {
    background-color: #4b5563;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #4b5563;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #4b5563;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #4b5563;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #4b5563;
}

/* Toast container positioning */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter collapse animation */
.collapse {
    transition: all 0.3s ease;
}

/* Fixed table headers */
.table-responsive {
    position: relative;
}

.table-responsive thead th {
    position: sticky;
    top: 0;
    background-color: #212529;
    z-index: 10;
}

/* Better table spacing */
.table td, .table th {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Ensure table cells don't wrap unnecessarily */
.table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Allow wrapping for specific columns */
.table td:nth-child(2) { /* Title column */
    white-space: normal;
    max-width: 250px;
}

/* Column visibility toggle */
.column-hidden {
    display: none !important;
}

/* Search input with icon */
.input-group-text {
    background-color: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

/* Form labels spacing */
.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Responsive adjustments for users page */
@media (max-width: 768px) {
    .user-card {
        margin-bottom: 1rem;
    }
    
    .user-avatar {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Status indicators */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-active {
    background-color: #198754;
}

.status-inactive {
    background-color: #dc3545;
}

.status-pending {
    background-color: #ffc107;
}
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2d3748;
    border: 1px solid #495057;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #495057;
    display: flex;
    flex-direction: column;
}

.search-result-item:hover {
    background-color: #4b5563;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 600;
    color: #e9ecef;
}

.search-result-info {
    font-size: 0.875rem;
    color: #adb5bd;
    margin-top: 0.25rem;
}

.search-result-type {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
}

.search-result-type.company { background: #0d6efd; color: white; }
.search-result-type.software { background: #198754; color: white; }
.search-result-type.hardware { background: #0dcaf0; color: black; }
.search-result-type.infrastructure { background: #ffc107; color: black; }