/* Custom styles for the application */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Status badges */
.badge.status-pending {
    background-color: var(--warning-color) !important;
    color: #000 !important;
}

.badge.status-partial {
    background-color: var(--info-color) !important;
}

.badge.status-paid {
    background-color: var(--success-color) !important;
}

.badge.status-overdue {
    background-color: var(--danger-color) !important;
}

/* Sidebar Client Search */
.submenu-search {
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    margin: 0.25rem 0;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.search-result-item {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease-in-out;
    border-bottom: 1px solid #e9ecef;
}

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

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

.search-result-name {
    font-weight: 500;
    color: #495057;
}

.search-result-rif {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.table-responsive {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}

/* Form elements */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn {
    font-weight: 500;
}

/* Dashboard cards */
.dashboard-card {
    transition: transform 0.2s;
}

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

/* Search and filter form */
.search-filters {
    background-color: #fff;
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
    }
    
    .search-filters {
        padding: 1rem;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Alert customization */
.alert {
    border: none;
    border-radius: 0.375rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Utility classes */
.text-currency {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.pending {
    background-color: var(--warning-color);
}

.status-indicator.partial {
    background-color: var(--info-color);
}

.status-indicator.paid {
    background-color: var(--success-color);
}

.status-indicator.overdue {
    background-color: var(--danger-color);
}

/* Sidebar Accordion Menu */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.sidebar.collapsed .sidebar-brand span {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.menu-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.menu-link.active {
    background-color: var(--primary-color);
    color: white;
}

.menu-link i {
    width: 20px;
    margin-right: 1rem;
    text-align: center;
}

.sidebar.collapsed .menu-link span {
    display: none;
}

.menu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.menu-item.open .menu-arrow {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0,0,0,0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-item.open .submenu {
    max-height: 300px;
}

.submenu-link {
    display: block;
    padding: 0.75rem 1rem 0.75rem 3rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s ease;
}

.submenu-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.submenu-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* Main content adjustment */
.main-content {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 70px;
}

/* Top navbar adjustment */
.top-navbar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .mobile-overlay.show {
        display: block;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .pagination,
    footer {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}
/* Currency utilities (simplified) */
.currency-input {
    font-family: 'Courier New', monospace;
    text-align: right;
}