/* Styles moved from legal_entity_list template to central stylesheet */
.table-container {
    overflow-x: auto;
}

.entity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

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

.entity-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.entity-table tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.status-badge:hover { opacity: 0.9; }

.action-btn { padding: 6px 12px; margin: 0 4px; font-size: 0.85rem; border-radius: 4px; text-decoration: none; display: inline-block; color: white; border: none; cursor: pointer; }
.btn-edit { background-color: #007bff; }
.btn-edit:hover { background-color: #0056b3; }
.btn-delete { background-color: #dc3545; }
.btn-delete:hover { background-color: #c82333; }

.gstn-code { font-family: monospace; background-color: #f8f9fa; padding: 4px 8px; border-radius: 4px; font-size: 0.9rem; }
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: #fafafa;
}

.form-section h3 {
    color: var(--brand-orange);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

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

.attachment-link {
    display: inline-block;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--brand-orange) 0%, #e67e22 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(222, 133, 25, 0.3);
}

.attachment-link:hover {
    background: linear-gradient(135deg, #e67e22 0%, var(--brand-orange) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(222, 133, 25, 0.4);
    color: white;
}

.no-attachment {
    padding: 15px 20px;
    background-color: #f0f0f0;
    color: var(--text-secondary);
    border-radius: 8px;
    text-align: center;
    border: 2px dashed #ddd;
}

input[type="file"] {
    padding: 8px;
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    background-color: #f9f9f9;
}

input[type="file"]:focus {
    border-color: var(--brand-orange);
    background-color: white;
}

small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Modal Improvements */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.modal-header h3 {
    margin: 0;
    color: var(--brand-orange);
    font-size: 1.5rem;
}

.close {
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    padding: 0 10px;
}

.close:hover {
    color: var(--brand-orange);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* Invoice Details Container */
.invoice-details-container {
    padding: 30px;
}

.details-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.details-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--brand-orange);
}

.section-title {
    color: var(--brand-orange);
    font-size: 1.1rem;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.detail-row:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.detail-row.highlight {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid var(--brand-orange);
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.amount-highlight {
    color: var(--brand-orange);
    font-size: 1.2rem;
    font-weight: 700;
}

.note-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--brand-orange);
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Vendor Details Styles */
.vendor-details-container {
    padding: 30px;
}

.details-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.details-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--brand-orange);
}

.section-title {
    color: var(--brand-orange);
    font-size: 1.1rem;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.detail-row:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.detail-row.highlight {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid var(--brand-orange);
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.amount-highlight {
    color: var(--brand-orange);
    font-size: 1.2rem;
    font-weight: 700;
}

.note-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--brand-orange);
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--brand-orange);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Vendor Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin-right: 10px;
}

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

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

/* Download PDF Button */
.btn-download {
    background-color: #17a2b8;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background-color: #138496;
    transform: translateY(-1px);
}

.btn-download:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Error Message Improvements */
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--error);
    font-size: 1.1rem;
}

.error-message h3 {
    margin-bottom: 15px;
    color: var(--error);
}

.error-message p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.error-message .btn {
    background-color: var(--brand-orange);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.error-message .btn:hover {
    background-color: var(--brand-orange-hover);
    transform: translateY(-1px);
}

/* User Filter Styling */
.user-filter-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.user-filter-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #dee2e6;
    background: white;
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--brand-orange);
    color: white;
    border-color: var(--brand-orange);
}

.filter-btn.active:hover {
    background: #e67e22;
    border-color: #e67e22;
}

/* Role badge styles for new vendor/uploader split */
.role-badge.role-vendor {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.role-badge.role-uploader {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* Hide/Show Approve Limit Field */
.form-group.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .invoice-details-container {
        padding: 15px;
    }
    
    .vendor-details-container {
        padding: 15px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-value {
        text-align: left;
    }
}