/* StaXGP Main Styles */

/* Invoice Email & PDF Styles */
.invoice-email-container {
    font-family: Arial, sans-serif; 
    line-height: 1.6; 
    color: #333; 
    margin: 0; 
    padding: 20px; 
    background-color: #f7f7f7;
}

.invoice-container { 
    max-width: 800px; 
    margin: 0 auto; 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.invoice-header { 
    padding: 30px; 
    background-color: #f8f9fa; 
    border-bottom: 3px solid #007bff;
}

.invoice-content { 
    padding: 30px;
}

.company-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.company-logo {
    height: 60px;
    width: auto;
}

.company-text h2 { 
    margin: 0 0 15px 0; 
    color: #007bff; 
    font-size: 24px;
}

.company-details { 
    color: #666; 
    margin-bottom: 20px;
}

.invoice-details { 
    text-align: right;
}

.invoice-title { 
    font-size: 36px; 
    font-weight: bold; 
    color: #007bff; 
    margin: 0 0 20px 0;
}

.detail-row { 
    margin: 8px 0;
}

.client-section { 
    margin: 30px 0; 
    padding: 20px; 
    background-color: #f8f9fa; 
    border-radius: 6px;
}

.client-section h3 { 
    margin: 0 0 15px 0; 
    color: #333;
}

.invoice-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin: 20px 0;
}

.invoice-table th, 
.invoice-table td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #ddd;
}

.invoice-table th { 
    background-color: #f8f9fa; 
    font-weight: 600; 
    color: #333;
}

.text-right { 
    text-align: right;
}

.text-center { 
    text-align: center;
}

.totals-section { 
    margin: 30px 0; 
    display: flex; 
    justify-content: flex-end;
}

.totals-table { 
    width: 300px;
}

.totals-table tr:last-child { 
    border-top: 2px solid #333; 
    font-weight: bold; 
    font-size: 16px;
}

.status-badge { 
    display: inline-block; 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 600; 
    text-transform: uppercase;
}

.status-paid { 
    background-color: #d4edda; 
    color: #155724;
}

.status-pending { 
    background-color: #fff3cd; 
    color: #856404;
}

.status-sent { 
    background-color: #cce7ff; 
    color: #004085;
}

.status-overdue { 
    background-color: #f8d7da; 
    color: #721c24;
}

.custom-message { 
    background-color: #e3f2fd; 
    padding: 15px; 
    border-radius: 6px; 
    margin: 20px 0; 
    border-left: 4px solid #007bff;
}

.footer-section { 
    margin-top: 30px; 
    padding-top: 20px; 
    border-top: 1px solid #ddd; 
    color: #666;
}

.text-green { 
    color: #28a745;
}

.text-red { 
    color: #dc3545;
}

.font-bold { 
    font-weight: bold;
}

/* ============================================================================
   CLIENT MANAGEMENT & ADMIN UI STYLES
   ============================================================================ */

/* Loading state for forms */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Smooth transitions for modals */
.modal-transition {
    transition: opacity 0.3s ease-in-out;
}

.modal-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced form focus states */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

/* Better table hover effects */
.table-row:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

/* Action button improvements */
.btn-action {
    transition: all 0.2s ease-in-out;
}

.btn-action:hover {
    transform: translateY(-1px);
}

/* Alert animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-notification {
    animation: slideInRight 0.3s ease-out;
}

/* Enhanced search input */
.search-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z'/%3e%3c/svg%3e");
    background-position: left 12px center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    padding-left: 40px;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

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

.status-active {
    background-color: #10b981;
}

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

/* Card hover effects */
.card-hover {
    transition: all 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Mobile responsiveness improvements */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .mobile-stack > * {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Print styles for PDF generation */
@media print { 
    .invoice-email-container { 
        background-color: white;
        padding: 0;
    }
    
    .invoice-container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .company-logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    * { 
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Admin layout styles */
.admin-layout {
    background: #f9fafb;
    min-height: 100vh;
    display: flex;
}

.admin-sidebar {
    background: #374151;
    color: white;
    width: 16rem;
    padding: 1.75rem 0.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
}

.admin-main {
    margin-left: 16rem;
    flex: 1;
}

.admin-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.admin-content {
    padding: 1.5rem;
}

/* Responsive admin layout */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
}

/* Public layout */
.public-layout {
    padding-top: 4rem;
}

/* Chart container styles */
.chart-container {
    position: relative;
    height: 500px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-container {
        height: 350px;
    }
}

/* Invoice view print styles */
@media print {
    .no-print { 
        display: none !important; 
    }
    .print-full-width { 
        width: 100% !important; 
        margin: 0 !important; 
        padding: 0 !important; 
    }
    body { 
        font-size: 12px; 
    }
}
