/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.btn-primary {
    background-color: #4a69bd;
    color: white;
}

.btn-primary:hover {
    background-color: #3c5aa6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 105, 189, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-outline {
    background-color: #ffffff;
    border: 1.5px solid #e0e0e0;
    color: #333;
    font-weight: 500;
}

.btn-outline:hover {
    background-color: #f8f9fa;
    border-color: #d0d0d0;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background-color: #e3f2fd;
    color: #1976d2;
}

.stat-icon.orange {
    background-color: #fff3e0;
    color: #f57c00;
}

.stat-icon.green {
    background-color: #e8f5e9;
    color: #388e3c;
}

.stat-content h3 {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-content .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-content .stat-subtitle {
    font-size: 14px;
    color: #999;
    margin-top: 5px;
}

/* Financial Summary */
.financial-summary {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.financial-summary h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.financial-item {
    text-align: center;
    padding: 15px;
    border-right: 1px solid #e0e0e0;
}

.financial-item:last-child {
    border-right: none;
}

.financial-item .label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.financial-item .value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.financial-item.danger .value {
    color: #e74c3c;
}

/* Filters */
.filters-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.filters-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    height: 44px;
    background-color: #ffffff;
    transition: all 0.2s ease !important;
}

.filter-group input {
    padding: 12px 16px !important;
}

.filter-group input:focus {
    outline: none !important;
    border-color: #4a69bd !important;
    box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.1) !important;
}

/* Button group styling */
.filter-group:last-child {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.filter-group:last-child .btn {
    height: 44px;
    padding: 0 24px;
    font-size: 15px;
    min-width: 100px;
}

/* Tickets Table */
.tickets-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.tickets-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tickets-header h2 {
    font-size: 20px;
    color: #2c3e50;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
}

.tickets-table thead {
    background-color: #f8f9fa;
}

.tickets-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #666;
    font-size: 14px;
    border-bottom: 2px solid #e0e0e0;
}

.tickets-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.tickets-table tbody tr {
    transition: background-color 0.2s ease;
}

.tickets-table tbody tr:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* Priority Badges */
.priority-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.priority-high {
    background-color: #ffebee;
    color: #c62828;
}

.priority-medium {
    background-color: #fff8e1;
    color: #f57f17;
}

.priority-low {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-open {
    background-color: #e3f2fd;
    color: #1565c0;
}

.status-in-progress {
    background-color: #fff3e0;
    color: #e65100;
}

.status-closed {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Forms */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: 900px;
    margin: 30px auto;
}

.form-header {
    margin-bottom: 30px;
}

.form-header h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.form-header p {
    color: #666;
}

.form-section {
    margin-bottom: 32px;
    padding: 32px;
    background: #f3f6fb;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 18px rgba(31, 56, 88, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(186, 204, 230, 0.6);
}

.form-section:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 28px rgba(31, 56, 88, 0.12);
    border-color: rgba(74, 105, 189, 0.4);
}

.form-section:last-child {
    margin-bottom: 25px;
}

.dynamic-fields-section {
    background: linear-gradient(135deg, #ebf2ff 0%, #f6f9ff 100%) !important;
    border-left: 1px solid #4a69bd !important;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.form-section h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #4a69bd 0%, #5a7fd8 100%);
}

.form-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.form-section.compact {
    margin-bottom: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 10px;
    align-items: start;
}

.form-group,
.form-group-full {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
}

.form-group-full {
    grid-column: 1 / -1;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4a69bd;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input[type="file"] {
    padding: 8px;
}

.currency-input {
    position: relative;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    background: #fafbfc;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.currency-input::before {
    content: '$';
    position: absolute;
    left: 18px;
    color: #718096;
    font-weight: 600;
    font-size: 15px;
    z-index: 1;
    pointer-events: none;
}

.currency-input input {
    width: 100%;
    border: none !important;
    outline: none !important;
    padding: 14px 18px 14px 36px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    background: transparent;
    color: #2c3e50;
}

.currency-input:hover {
    border-color: #cbd5e0;
    background-color: #ffffff;
    transform: translateY(-1px);
}

.currency-input:focus-within {
    border-color: #4a69bd;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(74, 105, 189, 0.15), 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Checkbox Group Enhancement */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background-color: #f7fafc;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 48px;
}

.checkbox-group:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    user-select: none;
    line-height: 1.5;
}

/* File Upload Styles */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
}

.file-upload-label:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* Drag and drop highlight styles */
.file-upload-wrapper.highlight .file-upload-label {
    background-color: #f0f7ff !important;
    border-color: #4a69bd !important;
    border-width: 2px;
    box-shadow: 0 0 10px rgba(74, 105, 189, 0.2);
}

.file-upload-wrapper.dragging .file-upload-label::after {
    content: 'Drop PDFs here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 600;
    color: #4a69bd;
    pointer-events: none;
}

.file-upload-wrapper.highlight .file-upload-icon,
.file-upload-wrapper.highlight .file-upload-text {
    opacity: 0.3;
}

.file-upload-icon {
    font-size: 24px;
}

.file-upload-text {
    font-size: 16px;
    color: #6c757d;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 8px;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-item-name {
    font-weight: 500;
    color: #333;
}

.file-item-size {
    color: #6c757d;
    font-size: 14px;
}

.file-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.file-item-remove:hover {
    background-color: #f8d7da;
}

/* Form Actions Styling */
.form-actions {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

.form-actions .btn {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, #4a69bd 0%, #5a7fd8 100%);
    box-shadow: 0 4px 12px rgba(74, 105, 189, 0.25);
}

.form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 105, 189, 0.35);
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #4a69bd;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #4a69bd;
}

.permissions-group {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.user-info:hover {
    background-color: #f0f0f0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .tickets-table {
        font-size: 14px;
    }
    
    .tickets-table th,
    .tickets-table td {
        padding: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state h3 {
    font-size: 20px;
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a69bd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Enhanced Dropdown Styles - Applied to all selects */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-repeat: no-repeat;
    cursor: pointer;
    font-weight: 400;
}

/* Enhanced Select Dropdown Styles */
.form-group select,
.form-group-full select,
.filter-group select {
    width: 100%;
    padding: 12px 45px 12px 18px !important;
    border: 1.5px solid #d0d9ec !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    background-color: #ffffff;
    color: #2c3e50;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    line-height: 1.4;
    min-height: 48px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-position: right 14px center;
    background-size: 18px;
    box-shadow: 0 2px 6px rgba(31, 56, 88, 0.06);
}

.form-group select:hover,
.form-group-full select:hover,
.filter-group select:hover {
    border-color: #b6c7e3 !important;
    box-shadow: 0 4px 12px rgba(31, 56, 88, 0.12);
    transform: translateY(-1px);
}

.form-group select:focus,
.form-group-full select:focus,
.filter-group select:focus {
    outline: none !important;
    border-color: #4a69bd !important;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(74, 105, 189, 0.18), 0 6px 18px rgba(31, 56, 88, 0.16) !important;
    transform: translateY(-1px);
}

/* Disabled state */
select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Option styles */
select option {
    padding: 10px;
    background-color: white;
    color: #333;
}

select option:hover {
    background-color: #f0f0f0;
}

/* Small select variant */
.select-sm {
    min-height: 36px;
    padding: 8px 40px 8px 12px !important;
    font-size: 14px !important;
}

/* Large select variant */
.select-lg {
    min-height: 52px;
    padding: 16px 50px 16px 20px !important;
    font-size: 16px !important;
}

/* Fix for Firefox */
@-moz-document url-prefix() {
    select {
        text-indent: -2px;
    }
}

/* Enhanced Form Field Styles */
.form-group > input,
.form-group-full > input,
.form-group > textarea,
.form-group-full > textarea {
    width: 100% !important;
    padding: 12px 18px !important;
    border: 1.5px solid #d0d9ec !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background-color: #ffffff;
    color: #2c3e50;
    line-height: 1.4;
    min-height: 48px;
    box-shadow: 0 2px 6px rgba(31, 56, 88, 0.06);
}

/* Textarea specific styling */
.form-group > textarea,
.form-group-full > textarea {
    min-height: 150px !important;
    resize: vertical;
    padding: 16px 18px !important;
    line-height: 1.6 !important;
    font-size: 15px !important;
}

/* Placeholder styling */
.form-group > input::placeholder,
.form-group > textarea::placeholder,
.form-group-full > input::placeholder,
.form-group-full > textarea::placeholder {
    color: #a0aec0;
    font-weight: 400;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

/* Hover effects */
.form-group input:hover,
.form-group textarea:hover,
.form-group-full input:hover,
.form-group-full textarea:hover {
    border-color: #b6c7e3 !important;
    box-shadow: 0 4px 12px rgba(31, 56, 88, 0.12);
    transform: translateY(-1px);
}

/* Focus effects */
.form-group input:focus,
.form-group textarea:focus,
.form-group-full input:focus,
.form-group-full textarea:focus {
    outline: none !important;
    border-color: #4a69bd !important;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(74, 105, 189, 0.18), 0 6px 18px rgba(31, 56, 88, 0.16) !important;
    transform: translateY(-1px);
}

/* Focus placeholder fade */
.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder,
.form-group-full input:focus::placeholder,
.form-group-full textarea:focus::placeholder {
    opacity: 0.5;
}

/* File input styling */
.file-upload-item input[type="text"] {
    padding: 10px 14px !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background-color: #fafbfc;
    transition: all 0.3s ease !important;
}

.file-upload-item input[type="text"]:hover {
    border-color: #cbd5e0 !important;
    background-color: #ffffff;
}

.file-upload-item input[type="text"]:focus {
    outline: none !important;
    border-color: #4a69bd !important;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.12) !important;
}

/* Label styling enhancement */
.form-group label,
.form-group-full label {
    display: block;
    margin-bottom: 10px;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.025em;
}

.form-group label.required::after,
.form-group-full label.required::after {
    content: " *";
    color: #ef4444;
    font-weight: 400;
}

/* Animation for form fields */
@keyframes fieldPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 105, 189, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(74, 105, 189, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 105, 189, 0);
    }
}

/* Add subtle animation on focus */
.form-group input:focus,
.form-group textarea:focus {
    animation: fieldPulse 0.5s ease-out;
}

/* Disabled state */
.form-group input:disabled,
.form-group textarea:disabled {
    background-color: #f3f4f6;
    border-color: #e5e7eb !important;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Error state styling (for future use) */
.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444 !important;
}

.form-group.error input:focus,
.form-group.error textarea:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}

/* Success state styling (for future use) */
.form-group.success input,
.form-group.success textarea {
    border-color: #10b981 !important;
}

.form-group.success input:focus,
.form-group.success textarea:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15) !important;
}

/* ========== Dashboard Modernization Styles ========== */

/* KPI Strip Enhancements */
.kpi-strip {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Enhanced Stat Cards */
.stat-card {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(74, 105, 189, 0.2);
}

.stat-card-header {
    position: relative;
    overflow: hidden;
}

.stat-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.stat-card:hover .stat-card-header::before {
    left: 100%;
}

/* Financial Summary Enhancements */
.financial-summary {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.financial-summary:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.financial-item.clickable {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.financial-item.clickable:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.financial-item.clickable:hover .label,
.financial-item.clickable:hover .value,
.financial-item.clickable:hover .trend {
    color: white !important;
}

/* Contracts Table Enhancements */
.contracts-table {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.contracts-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #666;
    padding: 15px 12px;
    border-bottom: 2px solid #e0e0e0;
}

.contracts-table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
}

/* Filter Container Enhancements */
.filters-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    transition: box-shadow 0.3s ease;
}

.filters-container:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* Advanced Filters Panel */
#advancedFiltersPanel {
    animation: expandDown 0.3s ease-out;
}

@keyframes expandDown {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 20px;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding: 20px;
    }
}

/* Button Enhancements */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

/* Badge Enhancements */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-personal {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-ggocc-company-related {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-client {
    background: #e8f5e9;
    color: #388e3c;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .kpi-strip {
        flex-wrap: wrap;
    }
    
    .kpi-chip {
        min-width: calc(50% - 8px);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .financial-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-chip {
        min-width: 100%;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100% !important;
        min-width: 100% !important;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a69bd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltip Enhancement */
[title] {
    position: relative;
    cursor: help;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #4a69bd;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header-actions,
    .filters-container,
    .kpi-strip,
    .btn {
        display: none !important;
    }

    body {
        background: white;
    }

    .contracts-table {
        box-shadow: none;
    }
}

/* =============================================================================
   AI Contract Analysis Styles
   ============================================================================= */

/* AI Analysis Card */
.ai-analysis-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e3f2fd 100%);
    border: 2px dashed #4a90d9;
    border-radius: 12px;
    overflow: hidden;
}

.ai-card-header {
    background: linear-gradient(135deg, #4a90d9 0%, #5c6bc0 100%);
    color: white;
    padding: 15px 25px;
}

.ai-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-card-header h3::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z'/%3E%3Ccircle cx='7.5' cy='14.5' r='1.5'/%3E%3Ccircle cx='16.5' cy='14.5' r='1.5'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.ai-card-body {
    padding: 25px;
}

.ai-description {
    color: #555;
    margin-bottom: 20px;
    font-size: 15px;
}

/* AI Dropzone */
.ai-dropzone {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.ai-dropzone:hover,
.ai-dropzone.ai-dragover {
    border-color: #4a90d9;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.ai-dropzone-icon {
    color: #4a90d9;
    margin-bottom: 15px;
}

.ai-dropzone-text {
    color: #555;
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.ai-dropzone-text a {
    color: #4a90d9;
    text-decoration: underline;
}

.ai-dropzone-text a:hover {
    color: #3a7bc8;
}

.ai-dropzone-hint {
    color: #999;
    font-size: 13px;
    margin: 0;
}

/* AI Progress */
.ai-progress-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.ai-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a90d9, #5c6bc0);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.ai-progress-text {
    text-align: center;
    color: #555;
    margin: 0;
    font-size: 14px;
}

/* AI Error */
.ai-error {
    background: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
    padding: 12px 18px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
}

/* AI Modal */
.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.ai-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ai-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.ai-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.ai-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.ai-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.ai-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.ai-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8f9fa;
}

/* AI Results Styling */
.ai-results .ai-result-section {
    margin-bottom: 25px;
}

.ai-results .ai-result-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.ai-detected-type {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ai-type-badge {
    background: linear-gradient(135deg, #4a90d9, #5c6bc0);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
}

.ai-subtype-badge {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
}

.ai-type-arrow {
    color: #999;
    font-size: 18px;
}

.ai-confidence {
    margin-left: auto;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 12px;
}

.ai-confidence-high {
    background: #e8f5e9;
    color: #2e7d32;
}

.ai-confidence-medium {
    background: #fff8e1;
    color: #f57c00;
}

.ai-confidence-low {
    background: #ffebee;
    color: #c62828;
}

.ai-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
}

/* AI Fields Table */
.ai-fields-table {
    width: 100%;
    border-collapse: collapse;
}

.ai-fields-table th,
.ai-fields-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.ai-fields-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    color: #555;
}

.ai-fields-table .ai-field-label {
    width: 35%;
    color: #555;
    font-size: 14px;
}

.ai-fields-table .ai-field-action {
    width: 40px;
    text-align: center;
}

.ai-field-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-field-input:focus {
    border-color: #4a90d9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.ai-field-input.ai-field-empty {
    background: #fafafa;
    color: #999;
}

.ai-btn-clear {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #999;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-btn-clear:hover {
    background: #ffebee;
    border-color: #ef5350;
    color: #c62828;
}

.ai-extraction-notes {
    background: #fff9e6;
    border: 1px solid #ffd54f;
    border-radius: 6px;
    padding: 15px;
    font-size: 14px;
    color: #5d4e37;
    line-height: 1.6;
}

/* AI Success Alert Animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.ai-success-alert {
    background: #e8f5e9 !important;
    border: 1px solid #4caf50 !important;
    color: #2e7d32 !important;
}

/* Responsive AI Styles */
@media (max-width: 768px) {
    .ai-modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .ai-detected-type {
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-confidence {
        margin-left: 0;
        margin-top: 10px;
    }

    .ai-fields-table .ai-field-label {
        width: 40%;
    }
}