/* Google Fonts - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    /* Colors */
    --bg-color: #e9ecff;
    --text-color: #121b1d;
    --primary-color: #35306d;
    --secondary-color: #029846;
    --white: #ffffff;
    --light-gray: #efefef;
    
    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Border Radius */
    --border-radius: 0.75rem;
    --border-radius-sm: 0.5rem;
    --border-radius-lg: 1rem;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* ===== GLOBAL RESET ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
}

/* ===== LAYOUT ===== */
.sidebar {
    background: var(--primary-color);
    min-height: 100vh;
    box-shadow: var(--shadow);
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
}

.main-content {
    background: var(--bg-color);
    min-height: 100vh;
    padding: 2rem;
    margin-left: 280px;
    overflow-x: hidden;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: var(--white) !important;
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--primary-color);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color) !important;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    margin: 0.25rem 0.5rem;
    transition: var(--transition);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white) !important;
    transform: translateX(5px);
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* ===== BUTTONS ===== */
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: #2b2859;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #02773a;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline-secondary {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--primary-color);
    color: var(--white);
}

.btn-success:hover {
    background: #2b2859;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #02773a;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-warning {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #02773a;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-info {
    background: var(--primary-color);
    color: var(--white);
}

.btn-info:hover {
    background: #2b2859;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===== FORMS ===== */
.form-control, .form-select {
    font-family: 'Poppins', sans-serif;
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(53, 48, 109, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

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

.input-group-text {
    background: var(--light-gray);
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    color: var(--text-color);
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--white);
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card-header {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0 !important;
    padding: 1.25rem 1.5rem !important;
    font-weight: 600 !important;
}

.card-header h5, .card-header h6 {
    color: var(--white) !important;
    margin-bottom: 0 !important;
    font-weight: 600 !important;
}

.card-body {
    padding: 1.5rem;
    background: var(--white);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    color: var(--text-color);
}

/* ===== STATISTICS CARDS ===== */
.stat-card {
    background: var(--white);
    border-radius: var(--border-radius-lg) !important;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    min-height: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
}

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

.stat-card.stat-success {
    border-left-color: var(--primary-color);
}

.stat-card.stat-warning {
    border-left-color: var(--secondary-color);
}

.stat-card.stat-danger {
    border-left-color: var(--secondary-color);
}

.stat-card.stat-info {
    border-left-color: var(--primary-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== TABLES ===== */
.table {
    font-family: 'Poppins', sans-serif;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.table thead th {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    border: none !important;
    padding: 1rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
    color: var(--text-color);
}

.table tbody tr:hover {
    background: rgba(53, 48, 109, 0.05);
    transform: scale(1.01);
    transition: var(--transition);
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: var(--light-gray);
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
}

.alert-danger {
    background: var(--light-gray);
    color: var(--text-color);
    border-left: 4px solid var(--secondary-color);
}

.alert-warning {
    background: var(--light-gray);
    color: var(--text-color);
    border-left: 4px solid var(--secondary-color);
}

.alert-info {
    background: var(--light-gray);
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
}

/* ===== MODALS ===== */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    color: var(--text-color);
}

/* ===== BADGES ===== */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    color: var(--primary-color);
    border-radius: var(--border-radius-sm);
    margin: 0 0.125rem;
    border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: rgba(53, 48, 109, 0.1);
    border-color: var(--primary-color);
}

/* ===== AVATAR ===== */
.avatar-sm {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 50%;
    background: var(--light-gray);
    color: var(--text-color);
}

.avatar-md {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
}

/* ===== TIMELINE ===== */
.timeline-item {
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 30px;
    bottom: -15px;
    width: 2px;
    background: #dee2e6;
}

.timeline-icon {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== MOBILE COMPONENTS ===== */
.mobile-header {
    background: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.offcanvas .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    margin: 0.25rem 0.5rem;
    transition: var(--transition);
}

.offcanvas .nav-link:hover,
.offcanvas .nav-link.active {
    background: rgba(255,255,255,0.1) !important;
    color: var(--white) !important;
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }

.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .main-content {
        margin-left: 250px;
        padding: 1.5rem;
    }
}

@media (max-width: 992px) {
    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
        max-height: none !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem;
    }
    
    .sidebar {
        width: auto;
        min-width: auto;
        position: fixed;
        transform: translateX(-100%);
        transition: var(--transition);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 0.75rem !important;
    }
    
    .card-header {
        padding: 1rem !important;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .stat-card {
        min-height: 100px;
        height: 100px;
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 0.5rem !important;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .mobile-header {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

.file-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

/* Company Grid */
.company-grid {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.company-item {
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    height: 100%;
}

.company-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    text-decoration: none;
    color: inherit;
}

.company-icon {
    transition: all 0.3s ease;
}

.company-item:hover .company-icon {
    transform: scale(1.05);
}

/* File Items */
.file-item {
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    height: 100%;
}

.file-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.file-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.file-item:hover .file-icon {
    transform: scale(1.1);
}

/* Breadcrumb */
.breadcrumb-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.breadcrumb {
    margin: 0;
    background: none;
    padding: 0;
}

.breadcrumb-item {
    color: var(--text-color);
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--text-color);
    font-weight: 600;
    margin: 0 0.5rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #2b2859;
    text-decoration: none;
}

/* Search Controls */
.search-controls {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(53, 48, 109, 0.25);
}

.input-group-text {
    background: var(--light-gray);
    border: 1px solid #ced4da;
    color: var(--text-color);
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #2b2859;
    border-color: #2b2859;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
}

/* Button Groups */
.btn-group .btn {
    border-radius: 0;
    border-right: none;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-right: 1px solid #ced4da;
}

.btn-group .btn:hover {
    transform: none;
    z-index: 2;
}

/* View Toggle Buttons */
.view-toggle .btn {
    border: 2px solid #ced4da;
    background: white;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.view-toggle .btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.view-toggle .btn:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Page Header */
.page-header {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.page-title {
    color: var(--text-color);
    font-weight: 700;
    font-size: 2rem;
    margin: 0;
}

.page-subtitle {
    color: var(--text-color);
    font-weight: 500;
    margin: 0;
}

/* Table Styling */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table th {
    background: var(--light-gray);
    border: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 1rem;
}

.table td {
    border-color: #e9ecef;
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-color);
}

.table tbody tr:hover {
    background-color: rgba(53, 48, 109, 0.03);
}

/* Tags */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid transparent;
}

.badge.bg-light {
    background: var(--light-gray) !important;
    color: var(--text-color) !important;
    border-color: #ced4da;
}

.badge.bg-primary {
    background: var(--primary-color) !important;
    border-color: var(--primary-color);
}

.badge.bg-secondary {
    background: var(--secondary-color) !important;
    border-color: var(--secondary-color);
}

/* Empty State */
.empty-state {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state i {
    color: var(--text-color);
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.empty-state h4 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-color);
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    margin: 2rem 0 0 0;
}

.page-link {
    color: var(--primary-color);
    border: 1px solid #ced4da;
    background: white;
    border-radius: 8px;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* File Type Icons */
.bi-file-pdf { color: var(--secondary-color); }
.bi-file-word { color: var(--primary-color); }
.bi-file-excel { color: var(--primary-color); }
.bi-file-image { color: var(--secondary-color); }
.bi-file-archive { color: var(--primary-color); }
.bi-file-text { color: var(--text-color); }
