/* In your CSS file */
.process-tab-content {
    display: none;
}

.process-tab-content.active {
    display: block;
}

/* Process Approval Flow Configuration */
.approval-config-section .section-header h6 {
    font-weight: 600;
}

.approval-config-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.approval-config-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.approval-config-toggle .toggle-info h6 {
    margin: 0;
    font-weight: 600;
}

.approval-config-toggle .toggle-info p {
    margin: 4px 0 0;
}

.approval-config-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.approval-config-hint {
    color: #64748b;
    font-size: 0.9rem;
}

.approval-approvers-list {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.approval-approver-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    font-size: 0.85rem;
    font-weight: 600;
}

.approval-approver-chip .chip-email {
    font-weight: 500;
    color: #475569;
}

.approval-approver-chip .chip-remove {
    cursor: pointer;
    color: #64748b;
}

.approval-modal .modal-header {
    border-bottom: 1px solid #e2e8f0;
}

.approval-modal-intro {
    margin-bottom: 16px;
}

.approval-modal-search {
    position: relative;
    margin-bottom: 12px;
}

.approval-modal-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.approval-modal-search input {
    padding-left: 36px;
}

.approval-user-list {
    max-height: 320px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 8px;
}

.approval-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.approval-user-item:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.approval-user-item input {
    margin-right: 4px;
}

.approval-user-item.selected {
    border-color: #4f46e5;
    background: #eef2ff;
}

.approval-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0f766e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.approval-user-info .approval-user-name {
    font-weight: 600;
}

.approval-user-info .approval-user-meta {
    color: #6b7280;
    font-size: 0.85rem;
}

.approval-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.approval-modal-footer-left {
    font-weight: 600;
    color: #475569;
}

.process-tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.process-tab-btn.active {
    border-bottom-color: #007bff;
    color: #007bff;
    font-weight: bold;
}

/* All Data Tab Styles */
.document-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border: 1px solid #e9ecef;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.document-card.invoice-card {
    border-top: 4px solid #3498db;
}

.document-card.po-card {
    border-top: 4px solid #2ecc71;
}

.document-card.grm-card {
    border-top: 4px solid #17a2b8;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.po-card .card-icon {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.grm-card .card-icon {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.card-title h5 {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

.card-body {
    padding: 20px;
}

.recent-items {
    max-height: 200px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

.recent-item:last-child {
    border-bottom: none;
}

.item-text {
    font-weight: 500;
    color: #495057;
}

.item-amount {
    font-weight: 600;
    color: #3498db;
}

.item-date {
    font-size: 12px;
    color: #6c757d;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

/* Fullscreen Table Styles */
.table-fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1050;
    padding: 20px;
    overflow-y: auto;
    display: none;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.table-header h4 {
    margin: 0;
    color: #2c3e50;
}

/* Modal Styles */
.document-details {
    padding: 10px;
}

.detail-item {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item strong {
    display: inline-block;
    width: 120px;
    color: #495057;
}

/* Search and Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 40px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.table-actions {
    display: flex;
    gap: 10px;
}

/* Table View Toggle + Card Layout */
.view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.view-toggle-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.view-toggle-btn.active {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.table-view-list.is-hidden {
    display: none;
}

.table-view-cards {
    display: none;
    margin-top: 16px;
}

.table-view-cards.is-active {
    display: grid;
}

.table-card-grid {
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.table-card {
    --card-accent: #0ea5e9;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    padding: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.table-card::before {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    top: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--card-accent), rgba(14, 165, 233, 0.2));
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.table-card-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 1rem;
}

.table-card-subtitle {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 2px;
}

.table-card-chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: capitalize;
    white-space: nowrap;
}

.table-card-body {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.table-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.table-card-meta-label {
    color: #94a3b8;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table-card-meta-value {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.85rem;
}

.table-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-card-actions .btn {
    border-radius: 999px;
}

.table-card-empty {
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-weight: 600;
}

/* All Data Card View */
.doc-card {
    --card-accent: #2563eb;
}

.doc-card.invoice {
    --card-accent: #2563eb;
}

.doc-card.po {
    --card-accent: #16a34a;
}

.doc-card.grm {
    --card-accent: #0ea5e9;
}

.doc-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--card-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.doc-card-heading {
    flex: 1;
    min-width: 0;
}

.doc-card-status {
    margin-left: auto;
}

.doc-card-status .status-badge {
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 999px;
}

.doc-card-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 1rem;
}

.doc-card-subtitle {
    color: #64748b;
    font-size: 0.85rem;
}

.doc-card-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.doc-card-field {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
}

.doc-card-field .label {
    display: block;
    color: #94a3b8;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.doc-card-field .value {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.9rem;
}

.doc-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.doc-card-actions .btn {
    border-radius: 999px;
}

@media (max-width: 768px) {
    .view-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

/* Badge Styles */
.badge {
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Animation for card expansion */
@keyframes expandCard {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.table-fullscreen-container {
    animation: expandCard 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .document-card {
        margin-bottom: 20px;
    }

    .table-controls {
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        width: 100%;
    }

    .table-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Document Type Selection Styles */
.document-type-selection {
    padding: 20px 0;
}

.document-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.document-type-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.document-type-card:hover {
    border-color: #4d90fe;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.document-type-card.selected {
    border-color: #4d90fe;
    background-color: #f0f7ff;
}

.document-type-card .card-icon {
    font-size: 2.5rem;
    color: #666;
    margin-bottom: 15px;
}

.document-type-card.selected .card-icon {
    color: #4d90fe;
}

.document-type-card .card-content h6 {
    margin: 0 0 5px 0;
    color: #333;
}

.document-type-card .card-content p {
    margin: 0;
    font-size: 0.9rem;
}

/* Extraction Status */
.extraction-in-progress {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.extraction-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.form-builder-type-indicator {
    display: inline-block;
    padding: 2px 8px;
    background: #007bff;
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-left: 10px;
    vertical-align: middle;
    font-weight: bold;
}

.po-form-builder .form-builder-type-indicator {
    background: #28a745;
    /* Green for PO */
}

.grm-form-builder .form-builder-type-indicator {
    background: #ffc107;
    /* Yellow for GRM */
    color: #212529;
}

/* Document Type Selection */
.document-type-selection {
    background: white;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
}

.document-type-cards {
    display: flex;
    gap: 20px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.document-type-card {
    flex: 1;
    min-width: 250px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.document-type-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.document-type-card.selected {
    border-color: #007bff;
    background: #e7f1ff;
}

.document-type-icon {
    font-size: 2.5rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.document-type-card.selected .document-type-icon {
    color: #007bff;
}

.document-type-content h6 {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #343a40;
}

.document-type-content p {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

.document-type-check {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #28a745;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.document-type-card.selected .document-type-check {
    opacity: 1;
}

.document-type-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* PO Form Builder Specific */
.po-form-builder .form-builder-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.po-form-builder .form-builder-header h4 {
    color: white;
}

/* GRM Form Builder Specific */
.grm-form-builder .form-builder-header {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.grm-form-builder .form-builder-header h4 {
    color: #212529;
}

/* Document Type Selection Styles */
.document-type-selection {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 30px;
    margin: 20px 0;
    border: 2px dashed #dee2e6;
}

.document-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.document-type-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.document-type-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.document-type-card.selected {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.document-type-card .document-type-icon {
    font-size: 2rem;
    color: #6c757d;
}

.document-type-card.selected .document-type-icon {
    color: #007bff;
}

.document-type-card .document-type-content h6 {
    margin: 0 0 5px 0;
    font-weight: 600;
}

.document-type-card .document-type-content p {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.document-type-card .document-type-check {
    margin-left: auto;
    color: #28a745;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.document-type-card.selected .document-type-check {
    opacity: 1;
}

.document-type-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Form Builder Type Indicator */
.form-builder-type-indicator {
    display: inline-block;
    padding: 4px 12px;
    background: #007bff;
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 10px;
}

/* PO Form Builder Specific Styles */
.po-form-builder .default-fields-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* GRM Form Builder Specific Styles */
.grm-form-builder .default-fields-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Updated Process Status with Flow Steps inline */
.process-status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    animation: slideInDown 0.3s ease;
    justify-content: space-between;
    /* Add this */
    flex-wrap: nowrap;
    /* Prevent wrapping */
}

.process-status.show {
    display: flex;
}

/* Process status content - updated */
.process-status-content {
    flex: 1;
    min-width: 200px;
    /* Ensure it has some minimum width */
}

/* Process flow container - updated positioning */
.process-status .process-flow-container {
    margin-left: 10px;
    /* Push to the right */
    flex-shrink: 0;
    /* Prevent shrinking */
}

.process-status .upload-process-flow {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Align to the right */
    margin: 0;
}

/* Adjust step icons for inline display */
.process-status .flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    /* Reduced gap */
    text-align: center;
    min-width: 60px;
    /* Adjust as needed */
}

.process-status .step-icon {
    width: 25px;
    /* Smaller for inline display */
    height: 25px;
    border-radius: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    /* Smaller font */
    background-color: #e9ecef;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.process-status .step-label {
    font-size: 11px;
    /* Smaller font */
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
    /* Prevent text wrapping */
}

.process-status .flow-connector {
    width: 20px;
    /* Shorter connectors */
    height: 2px;
    background-color: #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .process-status {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .process-status .process-flow-container {
        margin-right: 0;
        width: 10%;
    }

    .process-status .upload-process-flow {
        justify-content: center;
    }

    .process-status-content {
        text-align: center;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .process-status .upload-process-flow {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .process-status .flow-connector {
        display: none;
        /* Hide connectors on very small screens */
    }

    .process-status .flow-step {
        min-width: 50px;
    }
}


.process-status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background-color: #e9ecef;
    color: #6c757d;
    flex-shrink: 0;
    /* Prevent icon from shrinking */
}

.process-status.completed .process-status-icon {
    background-color: #28a745;
    color: white;
    animation: popIn 0.4s ease;
}

.process-status.error .process-status-icon {
    background-color: #dc3545;
    color: white;
}

.process-status-content {
    flex: 1;
}

.process-status-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
    font-size: 1.1rem;
}

.process-status-message {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Text Layer Styling - Fixed Alignment */
#process-text-layer {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.text-span {
    position: absolute;
    white-space: pre;
    cursor: text;
    color: transparent;
    background-color: transparent;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    font-family: Arial, sans-serif;
}

.text-span:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Ensure PDF preview container has proper positioning */
#process-pdf-preview-container {
    position: relative;
    display: block;
    width: 100%;
    overflow: auto;
}

#process-pdf-preview {
    display: block;
    max-width: none;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Selection highlight styling */
.text-span::selection {
    background-color: rgba(0, 123, 255, 0.55);
}

/* Drag and drop visual feedback */
.text-span.selected {
    background-color: rgba(255, 193, 7, 0.2);
}

/* Ensure text layer doesn't interfere with page navigation */
#process-page-nav {
    position: relative;
    z-index: 20;
}

/* Add this new section or update the existing document-form-layout */
.document-form-layout {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.document-form-layout .row {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.document-form-layout .col-lg-8 {
    flex: 0 0 calc(60% - 10px);
    min-width: 0;
}

.document-form-layout .col-lg-4 {
    flex: 0 0 calc(40% - 10px);
    min-width: 0;
}

.document-form-layout.form-builder-fullscreen .document-preview-col {
    display: none;
}

.document-form-layout.form-builder-fullscreen .form-builder-col {
    flex: 0 0 100%;
    max-width: 100%;
}

.document-viewer-container {
    height: 700px;
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

/* Form Builder Container */
.form-builder-container {
    height: 700px;
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.form-builder-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.form-builder-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.form-builder-actions {
    display: flex;
    gap: 8px;
}

.form-builder-container .default-fields-section,
.form-builder-container .custom-fields-section,
.form-builder-container .selected-fields-section {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    overflow-y: auto;
}

.form-builder-container .default-fields-section {
    flex-shrink: 0;
}

.form-builder-container .custom-fields-section {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.form-builder-container .selected-fields-section {
    max-height: 150px;
    overflow-y: auto;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .document-form-layout .row {
        flex-direction: column;
        gap: 20px;
    }

    .document-form-layout .col-lg-8,
    .document-form-layout .col-lg-4 {
        flex: 1;
    }

    .document-viewer-container,
    .form-builder-container {
        height: 500px;
    }
}

@media (max-width: 992px) {
    .document-form-layout .row {
        flex-direction: column;
    }

    .document-viewer-container,
    .form-builder-container {
        height: 500px;
    }
}

/* Form Tags Modal Container */
.form-tags-modal-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-tags-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-tags-header h4 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-tags-header .btn {
    color: rgb(103, 29, 29);
    border-color: rgba(255, 255, 255, 0.3);
}

.form-tags-header .btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.form-tags-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.form-tags-content .row {
    flex-wrap: nowrap;
    min-width: 900px;
}

.form-tags-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-tags-scroll-controls {
    display: flex;
    gap: 6px;
}

.form-tags-scroll-controls .btn {
    padding: 6px 10px;
}

/* Tags Sidebar */
.tags-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    height: 100%;
    border: 1px solid #dee2e6;
}

.tags-search .input-group-text {
    background: white;
    border-right: none;
}

.tags-search .form-control {
    border-left: none;
    padding-left: 0;
}

.tags-search .form-control:focus {
    box-shadow: none;
    border-color: #ced4da;
}

.tag-category {
    margin-bottom: 20px;
}

.category-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-item {
    padding: 10px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.tag-item:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tag-item.selected {
    background: #e7f4ff;
    border-color: #007bff;
    border-left: 3px solid #007bff;
}

.tag-name {
    font-weight: 500;
    color: #495057;
    flex: 1;
}

.tag-value {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-indicator {
    color: #28a745;
    margin-left: 10px;
}

.tag-item.highlighted {
    background: #fff3cd;
    border-color: #ffc107;
}

.tags-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Selected Tags Preview */
.selected-tags-preview {
    background: white;
    border-radius: 8px;
    padding: 15px;
    height: 100%;
    border: 1px solid #dee2e6;
}

.selected-tags-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.selected-tag-item {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.selected-tag-item:hover {
    background: #e9ecef;
}

.tag-path {
    font-size: 13px;
    color: #495057;
    flex: 1;
}

.remove-tag-modal {
    padding: 2px 6px;
    font-size: 12px;
}

.remove-tag-modal:hover {
    color: #dc3545 !important;
}

.no-tags-message {
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.form-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.preview-table {
    max-height: 200px;
    overflow-y: auto;
}

.preview-table table {
    margin-bottom: 0;
}

.preview-table th {
    font-size: 12px;
    font-weight: 600;
    background: #e9ecef;
}

.preview-table td {
    font-size: 12px;
    padding: 6px 8px;
}


/* Document Form Layout */
.document-form-layout {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.document-viewer-container {
    height: 700px;
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.document-viewer-container .preview-header {
    background: #f8f9fa;
    padding: 4px;
    border-bottom: 1px solid #dee2e6;
    display: flex;

    gap: 10px;
}

.document-viewer-container .preview-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-weight: 500;
    color: #495057;
}

.page-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.page-info {
    font-size: 14px;
    color: #6c757d;
}

.document-viewer-container .pdf-preview-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background: #f5f5f5;
}

.document-viewer-container .pdf-page {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Form Builder Container */
.form-builder-container {
    height: 700px;
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.form-builder-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: rgb(17, 2, 2);
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-builder-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.form-builder-actions {
    display: flex;
    gap: 8px;
}

.form-builder-container .default-fields-section,
.form-builder-container .custom-fields-section,
.form-builder-container .selected-fields-section {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    overflow-y: auto;
}

.form-builder-container .custom-fields-section {
    flex: 1;
    overflow-y: auto;
}

.form-builder-container .selected-fields-section {
    max-height: 200px;
    overflow-y: auto;
}

/* Form Tags Modal */
#form-tags-modal .modal-dialog {
    max-width: 1200px;
}

#form-tags-modal .form-tags-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    height: 600px;
}

#form-tags-modal .tags-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
}

#form-tags-modal .form-builder {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 992px) {
    .document-form-layout .row {
        flex-direction: column;
    }

    .document-viewer-container,
    .form-builder-container {
        height: 500px;
    }

    #form-tags-modal .form-tags-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Professional zoom controls */
.zoom-controls .btn {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.zoom-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Scrollbar styling */
.document-viewer-container .pdf-preview-container::-webkit-scrollbar,
.form-builder-container .custom-fields-section::-webkit-scrollbar,
.form-builder-container .selected-fields-section::-webkit-scrollbar {
    width: 6px;
}

.document-viewer-container .pdf-preview-container::-webkit-scrollbar-track,
.form-builder-container .custom-fields-section::-webkit-scrollbar-track,
.form-builder-container .selected-fields-section::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.document-viewer-container .pdf-preview-container::-webkit-scrollbar-thumb,
.form-builder-container .custom-fields-section::-webkit-scrollbar-thumb,
.form-builder-container .selected-fields-section::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.document-viewer-container .pdf-preview-container::-webkit-scrollbar-thumb:hover,
.form-builder-container .custom-fields-section::-webkit-scrollbar-thumb:hover,
.form-builder-container .selected-fields-section::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* process document section  */
.upload-process-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.step-icon {
    width: 30px;
    height: 30px;
    border-radius: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background-color: #e9ecef;
    color: #6c757d;
    border: 3px solid #dee2e6;
}

.flow-step.active .step-icon {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.flow-step.completed .step-icon {
    background-color: #28a745;
    color: white;
    border-color: #1e7e34;
}

.step-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.flow-step.active .step-label {
    color: #007bff;
    font-weight: 600;
}

.flow-step.completed .step-label {
    color: #28a745;
}

.flow-connector {
    width: 40px;
    height: 3px;
    background-color: #dee2e6;
}

.flow-connector.completed {
    background-color: #28a745;
}

/* Process Status Indicator */
.process-status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.process-status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background-color: #e9ecef;
    color: #6c757d;
}

.process-status.completed .process-status-icon {
    background-color: #28a745;
    color: white;
}

.process-status.error .process-status-icon {
    background-color: #dc3545;
    color: white;
}

.process-status-content {
    flex: 1;
}

.process-status-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

.process-status-message {
    color: #6c757d;
    font-size: 14px;
}

.process-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Cancel Process Button */
.btn-cancel-process {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-cancel-process:hover {
    background-color: #5a6268;
}

/* Upload Success State */
.upload-area.completed {
    display: none;
}

.extraction-in-progress {
    text-align: center;
    padding: 30px 20px;
    background-color: #f8fafc;
    border: 2px dashed #cfe2ff;
    border-radius: 8px;
    margin: 20px 0;
}

.extraction-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Upload Success Message */
.upload-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-success-message i {
    color: #28a745;
    font-size: 20px;
}

/* Process Flow Container 
.process-flow-container {
    background: white;
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
} */

/* Responsive adjustments for process flow */
@media (max-width: 768px) {
    .upload-process-flow {
        flex-direction: column;
        gap: 0x;
    }

    .flow-connector {
        width: 3px;
        height: 20px;
    }

    .process-status {

        text-align: center;
        gap: 5px;
    }

    .process-actions {
        flex-direction: column;
        width: 100%;
    }

    .process-actions .btn {
        width: 100%;
    }
}

/* Processing Container */
.processing-container {
    display: flex;
    gap: 25px;
}

.document-viewer-container {
    flex: 1;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.form-section {
    width: 400px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.form-header {
    margin-bottom: 20px;
}

.form-header h3 {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.form-header h3 i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Tabs 


/* Status Messages */
.status-message {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    display: none;
}

.status-message.success {
    display: block;
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--secondary-color);
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.status-message.error {
    display: block;
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* Table Styles 

/* Modal Styles */

/* Modal styles 

  
  /* Amount details section 
 
  
  /* Loading spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-action {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
}

.btn-action:hover {
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .processing-container {
        flex-direction: column;
    }

    .document-viewer-container,
    .form-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        padding: 10px;
    }

    .logo {
        padding: 0 10px 0 0;
    }

    nav ul {
        display: flex;
        margin: 0;
    }

    nav li {
        margin: 0 5px;
    }

    nav a {
        padding: 10px;
    }

    .user-profile {
        margin-left: auto;
        padding: 0 10px;
        border: none;
    }

    .modal-content {
        width: 95%;
    }

    .invoice-detail-info {
        flex-direction: column;
        gap: 15px;
    }
}

/* Status badges */



/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Status Messages */
.status-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .settings-tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .settings-tab {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .settings-tab.active {
        border-left-color: #3498db;
    }

    .radio-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* Dashboard Styles */
.dashboard-content {
    padding: 20px;
}

.dashboard-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.overview-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);

    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.overview-card .card-icon {
    font-size: 2rem;
    margin-right: 15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overview-card .card-content h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.overview-card .card-value {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Card Colors */


/* Recent Activity */

/* Add dropdown styles */
.sidebar .dropdown {
    position: relative;
}

.sidebar .dropdown-menu {
    display: none;
    position: static;
    background-color: #2c3e50;
    padding-left: 20px;
    list-style: none;
}

.sidebar .dropdown-menu li {
    margin: 0;
}

.sidebar .dropdown-menu a {
    padding: 10px 15px;
    display: block;
    color: #b3b3b3;
    text-decoration: none;
}

.sidebar .dropdown-menu a:hover {
    color: white;
    background-color: #34495e;
}

.sidebar .dropdown:hover .dropdown-menu {
    display: block;
}

.sidebar .dropdown>a::after {
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: 5px;
}

/* Attachment styles */


/* Section visibility */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* PO Section Specific Styles */

/* Department Approval Styles */

/* Vendor Master Section Styles */

/* User Management Section Styles */


/* Empty State Styles */
.empty-state {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px;
    margin-top: auto;
    border-top: 1px solid #e1e1e1;
    background-color: #f8f9fa;
}

.logout-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    margin-left: auto;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s;
}

.logout-btn:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.logout-btn i {
    margin-right: 5px;
}

/* Status messages */
.status-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.status-message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    opacity: 1;
}

.status-message.error {
    background-color: #ffebee;
    color: #d32f2f;
    opacity: 1;
}

.status-message.warning {
    background-color: #fff8e1;
    color: #ffa000;
    opacity: 1;
}

.status-message.info {
    background-color: #e3f2fd;
    color: #1976d2;
    opacity: 1;
}

/* Loading spinner */
#loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
}

.spinner-container {
    text-align: center;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #4a6bff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.progress-text {
    color: #333;
    font-size: 16px;
    margin-top: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* DataTables Error Styling */
.alert-danger {
    padding: 10px 15px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

#users-table_processing {
    padding: 10px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.spinner-border.text-primary {
    width: 2rem;
    height: 2rem;
    margin: 10px auto;
    display: block;
}

/* User Table Styling */
.user-actions {
    display: flex;
    gap: 5px;
}

.status-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.badge.role-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
}

.badge.role-badge.admin {
    background-color: #6f42c1;
}

.badge.role-badge.ap {
    background-color: #20c997;
}

.badge.role-badge.cfo {
    background-color: #fd7e14;
}

.badge.role-badge.manager {
    background-color: #6610f2;
}

.user-name {
    font-weight: 500;

}

.user-email {
    color: #0d6efd;
    text-decoration: none;
}

.user-email:hover {
    text-decoration: underline;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    z-index: 1990;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.modal-close:hover {
    color: #495057;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #0d6efd;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

.btn-outline-danger {
    background-color: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}

/* Switch styling (existing) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #198754;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* General Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #f8f9fa;
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 600px;
    border: none;
    animation: slideDown 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #343a40;
}

.close-modal {
    color: #6c757d;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #343a40;
    text-decoration: none;
}

.modal-body {
    padding: 15px 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button Styling */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-outline {
    color: #6c757d;
    background-color: transparent;
    border-color: #6c757d;
}

.btn-outline:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Status Messages */
.status-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table th {
    background-color: #f8f9fa;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 12px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #28a745;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Select2 Customization */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    min-height: 38px;
    padding: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #007bff;
    border: 1px solid #0069d9;
    color: white;
    padding: 0 5px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-right: 5px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .user-management-tabs {
        flex-wrap: wrap;
    }

    .user-management-tab {
        margin-bottom: 5px;
    }
}

/* Invoice Template Tab Styles */
.upload-section {
    margin-bottom: 1rem;
}

.upload-section h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-section p {
    color: #7f8c8d;
    /*margin-bottom:1rem; */
}

.upload-container {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    background: #fff;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-height: 200px;
}

.upload-area.highlight {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: #95a5a6;
    margin-bottom: 1rem;
}

.upload-area p {
    font-size: 1.1rem;
    color: #34495e;
    margin-bottom: 0.5rem;
}

.upload-area span {
    color: #7f8c8d;
    margin: 0.5rem 0;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 1.5rem;
}

.file-icon i {
    font-size: 2rem;
    color: #e74c3c;
}

.file-details h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

.file-details p {
    margin: 0.25rem 0 0;
    color: #7f8c8d;
    font-size: 0.875rem;
}

.extraction-controls {
    text-align: center;
}

.preview-section {
    margin: 2rem 0;
}

.preview-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pdf-preview-container {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
    overflow: auto;
    max-height: 500px;
}

#pdf-preview {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.extraction-results {
    margin: 2rem 0;
}

.extraction-results h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.json-viewer {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
    max-height: 400px;
    overflow: auto;
    margin-bottom: 1.5rem;
}

.json-viewer pre {
    margin: 0;
    font-family: 'Fira Code', 'Monaco', 'Consolas', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #2c3e50;
}

.extraction-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Invoice Data Tab Styles */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-box input {
    width: 100%;
   
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.875rem;
}

.table-actions {
    display: flex;
    gap: 0.75rem;
}

#invoice-data-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

#invoice-data-table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

#invoice-data-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    color: #2c3e50;
}

#invoice-data-table tr:last-child td {
    border-bottom: none;
}

#invoice-data-table tr:hover {
    background-color: #f8f9fa;
}

/* Invoice Data Details Modal */
.invoice-data-details {
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.875rem;
}

.detail-value {
    color: #2c3e50;
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-area {
        padding: 1.5rem;
        min-height: 150px;
    }

    .upload-area i {
        font-size: 2rem;
    }

    .file-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .extraction-actions {
        flex-direction: column;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Form validation styles */
.is-invalid {
    border-color: #dc3545 !important;
}

.is-valid {
    border-color: #198754 !important;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.pan-gstin-error-msg,
.field-error-msg {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #dc3545;
}

@keyframes pan-gstin-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.pan-gstin-shake {
    animation: pan-gstin-shake 0.4s;
}

.vendor-custom-fields-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.vendor-custom-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}

.vendor-custom-field-row .vendor-custom-field-remove {
    flex: 0 0 auto;
}

@media (max-width: 576px) {
    .vendor-custom-field-row {
        grid-template-columns: 1fr;
    }
}

.was-validated .form-control:invalid~.invalid-feedback,
.form-control.is-invalid~.invalid-feedback {
    display: block;
}

/* Status message styles */
.status-message {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: none;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* Upload area styling */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #f8f9fa;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #007bff;
    background-color: #e8f4ff;
}

.upload-area i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
}

.upload-area h4 {
    color: #495057;
    margin-bottom: 10px;
}

.upload-area p {
    color: #6c757d;
    margin-bottom: 15px;
}

/* Uploaded file info */
.uploaded-file-info {
    margin-bottom: 20px;
}

.file-details {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.file-details i {
    font-size: 24px;
    color: #e74c3c;
    margin-right: 15px;
}

.file-info {
    flex-grow: 1;
}

.file-name {
    display: block;
    font-weight: 500;
    color: #495057;
}

.file-size {
    display: block;
    font-size: 12px;
    color: #6c757d;
}

/* Preview section */
.preview-section {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background-color: #f8f9fa;
}

.preview-section h5 {
    margin-bottom: 15px;
    color: #495057;
}

.pdf-preview {
    max-height: 400px;
    overflow: auto;
    border: 1px solid #dee2e6;
    background-color: white;
    padding: 10px;
}

/* JSON output styling */
.json-container {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background-color: #f8f9fa;
}

.json-container h6 {
    margin-bottom: 10px;
    color: #495057;
}

.json-output {
    max-height: 300px;
    overflow: auto;
    background-color: #2d2d2d;
    color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.json-output pre {
    margin: 0;
    white-space: pre-wrap;
}

/* Invoice detail styling */
.invoice-detail-container {
    max-height: 70vh;
    overflow-y: auto;
}

.invoice-detail-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.invoice-detail-section h4 {
    color: #495057;
    margin-bottom: 15px;
}

.invoice-detail-section h4 i {
    margin-right: 10px;
    color: #007bff;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
}

.detail-label {
    font-weight: 500;
    min-width: 150px;
    color: #6c757d;
}

.detail-value {
    flex-grow: 1;
    color: #495057;
}

.json-viewer {
    background-color: #2d2d2d;
    color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 200px;
    overflow: auto;
}

.invoice-detail-actions {
    display: flex;
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-area {
        padding: 20px;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-label {
        min-width: auto;
        margin-bottom: 5px;
    }
}

/* Add these styles to your CSS file for better error display */
.error-details {
    font-size: 0.9em;
    margin: 5px 0 0 0;
    color: #721c24;
    background-color: #f8d7da;
    padding: 5px 10px;
    border-radius: 4px;
    border-left: 3px solid #f5c6cb;
}

.manual-entry-form {
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.extraction-retry-options {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* Add these styles to your CSS file */
.progress {
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
}

.alert-danger {
    border-left: 5px solid #dc3545;
}

.alert-info {
    border-left: 5px solid #17a2b8;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.me-2 {
    margin-right: 0.5rem;
}

/* Modal Styles */
#invoice-data-detail-modal .modal-content {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#invoice-data-detail-modal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

#invoice-data-detail-modal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

#invoice-data-detail-modal .modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

#invoice-data-detail-modal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Invoice Data Detail Styles */
.invoice-data-detail-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95rem;
    color: #333;
}

.invoice-data-detail-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.invoice-data-detail-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.invoice-data-detail-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.invoice-data-detail-section h4 i {
    color: #007bff;
}

.detail-row {
    display: flex;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #555;
    flex: 0 0 180px;
    margin-right: 1rem;
}

.detail-value {
    flex: 1;
    color: #333;
    word-break: break-word;
}

/* JSON Viewer Styles */
.json-viewer {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.json-viewer pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 0.9rem;
    color: #333;
}

/* Scrollbar Styles for JSON Viewer */
.json-viewer::-webkit-scrollbar {
    width: 8px;
}

.json-viewer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.json-viewer::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.json-viewer::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .detail-row {
        flex-direction: column;
    }

    .detail-label {
        flex: none;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
}

/* Form Tags Styles */
.form-tags-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: 500px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.tags-sidebar {
    background: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}

.form-builder {
    padding: 20px;
    overflow-y: auto;
}

.tag-category {
    margin-bottom: 20px;
}

.category-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #007bff;
}

.tag-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-item:hover {
    background: #e3f2fd;
    border-color: #007bff;
}

.tag-item.selected {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.tag-item.highlighted {
    background: #fff3cd;
    border-color: #ffc107;
}

.tag-name {
    font-weight: 500;
}

.tag-value {
    font-size: 0.8em;
    color: #6c757d;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    min-height: 40px;
}

.selected-tag {
    background: #007bff;
    color: rgb(14, 56, 222);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-tag {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px;
    border-radius: 2px;
}

.remove-tag:hover {
    background: rgba(255, 255, 255, 0.2);
}

.no-tags-message {
    color: #6c757d;
    font-style: italic;
}

.form-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.generated-form .form-group {
    margin-bottom: 1rem;
}

.generated-form label {
    font-weight: 500;
    color: #495057;
}

.preview-table {
    max-height: 400px;
    overflow-y: auto;
}

.preview-table table {
    font-size: 0.9em;
}

.preview-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.extraction-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .form-tags-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .tags-sidebar {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
}



/* File Splitter Styles */
.splitter-container {
    max-width: 1200px;
    margin: 0 auto;
}

.file-info-card {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.file-info-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 2rem;
    color: #e74c3c;
}

.file-details h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.file-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #6c757d;
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.preview-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.page-navigation,
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#splitter-pdf-preview canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.split-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.option-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.option-icon {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 10px;
}

.option-content h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.option-content p {
    color: #6c757d;
    margin-bottom: 15px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.range-inputs input {
    width: 80px;
}

.output-settings {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #6c757d;
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

.detail-label {
    font-weight: 600;
    color: #2c3e50;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.summary-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.summary-card i {
    font-size: 2rem;
    color: #27ae60;
    margin-bottom: 10px;
}

.summary-content h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.summary-content p {
    color: #6c757d;
    margin: 5px 0 0 0;
}

.files-list-container {
    margin: 20px 0;
}

.files-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f1f1;
    gap: 15px;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item i {
    color: #e74c3c;
    font-size: 1.2rem;
}

.file-info {
    flex: 1;
}

.file-name {
    display: block;
    font-weight: 500;
    color: #2c3e50;
}

.file-size {
    font-size: 0.8rem;
    color: #6c757d;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Upload area enhancements */
.upload-area.dragover {
    border-color: #3498db;
    background-color: #f8fafc;
}

.upload-area.dragover .upload-content {
    transform: scale(1.02);
}

/* Responsive design */
@media (max-width: 768px) {
    .split-options-grid {
        grid-template-columns: 1fr;
    }

    .preview-controls {
        flex-direction: column;
        gap: 10px;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .results-actions {
        flex-direction: column;
    }

    .range-inputs {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Form Tags Section Styling */
.form-tags-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.default-fields-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.default-fields-section h6 {
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
}

.default-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.default-fields-grid .form-group {
    margin-bottom: 0;
}

.default-fields-grid .form-control[readonly] {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #6c757d;
}

.extraction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.form-tags-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: 500px;
}

.tags-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
}

.form-builder {
    background: white;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

.tag-category {
    margin-bottom: 20px;
}

.category-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.tag-item {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-item:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.tag-item.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.tag-name {
    font-weight: 500;
}

.tag-value {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.tag-item.selected .tag-value {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    min-height: 40px;
    align-items: center;
}

.selected-tag {
    background: #007bff;
    color: rgb(58, 13, 221);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-tag {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 10px;
}

.no-tags-message {
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

.form-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.form-actions {
    display: flex;
    gap: 8px;
}

#generated-form .form-group {
    margin-bottom: 15px;
}

#generated-form .form-control {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
}

.json-viewer {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.json-viewer pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-tags-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .default-fields-grid {
        grid-template-columns: 1fr;
    }

    .form-tags-actions {
        flex-direction: column;
    }
}

/* Line Items Table Styles */
.line-items-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.line-items-section .section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.line-items-section .section-header h6 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
}

.line-items-section .section-header p {
    margin: 0;
    font-size: 0.9em;
}

#line-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

#line-items-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

#line-items-table td {
    padding: 10px 8px;
    border: 1px solid #dee2e6;
    text-align: right;
    vertical-align: middle;
}

#line-items-table td:first-child,
#line-items-table th:first-child {
    text-align: center;
    font-weight: 600;
}

#line-items-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

#line-items-table tr:hover {
    background-color: #e3f2fd;
    transition: background-color 0.2s ease;
}

/* Numeric columns styling */
.line-item-numeric {
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.line-item-amount {
    color: #2e7d32;
    font-weight: 600;
}

/* Table actions */
.table-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive design */
@media (max-width: 768px) {
    .line-items-section {
        padding: 15px;
    }

    #line-items-table {
        font-size: 0.75em;
    }

    #line-items-table th,
    #line-items-table td {
        padding: 6px 4px;
    }

    .table-actions {
        flex-direction: column;
    }
}

/* Context Menu Styles */
.context-menu {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.context-menu-header {
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
}

.context-menu-items {
    padding: 4px 0;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #212529;
    transition: background-color 0.15s;
}

.context-menu-item:hover {
    background-color: #e9ecef;
}

.context-menu-item i {
    width: 16px;
    text-align: center;
    color: #6c757d;
}

.context-menu-divider {
    height: 1px;
    background: #dee2e6;
    margin: 4px 0;
}

/* PDF Preview Container - FIXED */
.pdf-preview-container {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    overflow: auto;
    max-height: 600px;
    display: inline-block;
    /* Important for proper text alignment */
}

/* PDF Canvas */
#pdf-preview {
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    /* Allow clicks to pass through to text layer */
}

/* Text Layer - COMPLETELY FIXED VERSION */
.text-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1.0;
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    z-index: 2;
    font-family: sans-serif;
    /* Use standard font for consistency */
}

/* Individual text spans - CRITICAL FIXES */
.text-layer span {
    color: transparent !important;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    line-height: 1.0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

/* Text selection styles - FIXED */
.text-layer ::selection {
    background: rgba(0, 123, 255, 0.55) !important;
    color: transparent !important;
}

.text-layer ::-moz-selection {
    background: rgba(0, 123, 255, 0.55) !important;
    color: transparent !important;
}

/* Hover effect */
.text-layer span:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* PDF Page wrapper */
.pdf-page {
    position: relative;
    display: inline-block;
    /* Important for proper alignment */
    line-height: 0;
    /* Remove extra spacing */
}

/* Preview Controls */
.preview-controls {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.preview-controls .form-text {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.preview-controls .form-text i {
    margin-right: 8px;
    color: #007bff;
}

/* Assignment Toast */
.assignment-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #28a745;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    font-size: 14px;
}

.assignment-toast i {
    margin-right: 8px;
    color: #28a745;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Remove any default margins and padding */
#pdf-preview-container,
#pdf-preview-container * {
    box-sizing: border-box;
}

/* Ensure no interference from parent elements */
.preview-section {
    position: relative;
}

/* Fix for any potential transform issues */
#pdf-preview-container .text-layer {
    transform: none !important;
}

#pdf-preview-container .text-layer span {
    transform: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-preview-container {
        max-height: 400px;
    }

    .assignment-toast {
        top: 10px;
        right: 10px;
        left: 10px;
    }
}

/* Scrollbar styling */
.pdf-preview-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.pdf-preview-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.pdf-preview-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.pdf-preview-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Reset any potential conflicting styles */
#pdf-preview-container * {
    max-width: none !important;
    max-height: none !important;
}

/* Process Document Section Styles */
.process-document-tabs {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.process-tab-header {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.process-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
}

.process-tab-btn:hover {
    color: #495057;
    background: #e9ecef;
}

.process-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #fff;
}

.process-tab-content {
    display: none;
    padding: 20px;
}

.process-tab-content.active {
    display: block;
}

/* Process Log Drawer */
.process-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.process-section-header .section-title p {
    margin-bottom: 0;
}

.process-log-toggle {
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.process-queue-toggle {
    position: absolute;
    top: 16px;
    right: 92px;
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: #ffffff;
    color: #6d28d9;
    border-color: #a855f7;
}

.process-queue-toggle:hover {
    background: #f5f3ff;
    color: #581c87;
}

.process-queue-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    line-height: 1;
}

.email-invoice-queue-workspace {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.email-queue-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef2f7;
}

.email-queue-header h3 {
    margin: 12px 0 4px;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
}

.email-queue-header p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.email-queue-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    min-width: 190px;
}

.email-queue-actions .btn {
    min-height: 36px;
    white-space: nowrap;
}

.email-queue-actions #email-queue-process-all {
    width: 122px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
    font-weight: 700;
}

.email-queue-actions #email-queue-process-all:hover {
    border-color: #4338ca;
    background: #4338ca;
    color: #fff;
}

.email-queue-actions #email-queue-process-all i {
    color: #fff;
}

.email-queue-actions #email-queue-select-mode,
.email-queue-actions #email-queue-sync {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}

.email-queue-actions #email-queue-select-mode:hover,
.email-queue-actions #email-queue-sync:hover {
    border-color: #4338ca;
    background: #4338ca;
    color: #fff;
}

.email-queue-actions #email-queue-select-mode i,
.email-queue-actions #email-queue-sync i {
    color: #fff;
}

.email-queue-actions #email-queue-processing-settings {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    border-color: #e5e7eb;
    background: #f8fafc;
    color: #111827;
}

.email-queue-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.email-queue-status-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    background: #f8fafc;
}

.email-queue-status-card span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.email-queue-status-card strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 1rem;
}

.email-queue-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(150px, 0.8fr) minmax(190px, 1fr) minmax(136px, 0.7fr) minmax(136px, 0.7fr) auto;
    gap: 12px;
    align-items: end;
    margin: 16px 0 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
}

.email-queue-search {
    position: relative;
}

.email-queue-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.email-queue-search input {
    width: 100%;
    min-height: 38px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 7px 12px 7px 34px;
    font-size: 13px;
    background: #ffffff;
}

.email-queue-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
}

.email-queue-filter-field span {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.email-queue-filter-field select,
.email-queue-filter-field input {
    min-height: 38px;
    border-color: #dbe3ef;
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 0.82rem;
}

.email-queue-clear {
    min-height: 38px;
    border-radius: 8px;
    padding-inline: 14px;
    font-weight: 700;
}

.email-queue-message {
    min-height: 20px;
    margin: 4px 0 10px;
    font-size: 0.86rem;
    font-weight: 700;
}

.email-queue-message.is-error {
    color: #b91c1c;
}

.email-queue-message.is-success {
    color: #15803d;
}

.email-queue-message.is-info {
    color: #4338ca;
}

.email-queue-table-wrap {
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 520px;
}

.email-queue-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
}

.email-queue-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #475569;
    padding: 10px 12px;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #e5e7eb;
}

.email-queue-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #eef2f7;
    color: #0f172a;
    vertical-align: middle;
}

.email-queue-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.72rem;
    font-weight: 800;
}

.email-queue-status-badge.is-new {
    background: #dcfce7;
    color: #166534;
}

.email-queue-status-badge.is-unverified {
    background: #fef3c7;
    color: #92400e;
}

.email-queue-status-badge.is-ignored,
.email-queue-status-badge.is-failed {
    background: #e5e7eb;
    color: #4b5563;
}

.email-queue-row-actions {
    display: flex;
    gap: 5px;
}

.email-queue-row-actions button,
.email-queue-detail-head button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #dbe3ef;
    border-radius: 7px;
    background: #ffffff;
    color: #6d28d9;
}

.email-queue-empty,
.email-queue-empty-state {
    text-align: center;
    color: #64748b;
}

.email-queue-empty-state {
    padding: 36px 16px 12px;
}

.email-queue-empty-state i {
    font-size: 2rem;
    color: #8b5cf6;
    margin-bottom: 10px;
}

.email-queue-empty-state h4 {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 1rem;
}

.email-queue-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
}

.email-queue-detail-modal.is-open {
    display: block;
}

.email-queue-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.email-queue-detail-card {
    position: relative;
    margin: 32px auto;
    width: min(1180px, calc(100vw - 48px));
    height: min(760px, calc(100vh - 64px));
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.email-queue-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.email-queue-detail-head h4 {
    margin: 0;
    color: #111827;
    font-size: 1.08rem;
    font-weight: 800;
}

.email-queue-detail-head p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 0.84rem;
}

.email-queue-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 0;
    flex: 1;
    min-height: 0;
}

.email-queue-preview-panel {
    position: relative;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
}

.email-queue-preview-panel iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.email-queue-preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 700;
}

.email-queue-meta-panel {
    overflow: auto;
    padding: 16px;
}

.email-queue-detail-section {
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.email-queue-detail-section h5 {
    margin: 0 0 8px;
    color: #4c1d95;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.email-queue-detail-section p {
    margin: 0 0 8px;
    color: #334155;
    font-size: 0.85rem;
    word-break: break-word;
}

.email-queue-detail-section p span {
    display: block;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.email-queue-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.email-queue-process-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.email-queue-process-confirm-modal.is-open {
    display: flex;
}

.email-queue-process-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
}

.email-queue-process-confirm-card {
    position: relative;
    width: min(460px, 100%);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    padding: 22px;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 16px;
}

.email-queue-process-confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eaf2ff;
    color: #1d5fd1;
    font-size: 18px;
}

.email-queue-process-confirm-copy h4 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #172033;
}

.email-queue-process-confirm-copy p {
    margin: 0;
    color: #566274;
    font-size: 13px;
    line-height: 1.45;
}

.email-queue-process-confirm-meta {
    margin-top: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.email-queue-process-confirm-meta span {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    color: #334155;
}

.email-queue-process-confirm-meta span:last-child {
    border-bottom: 0;
}

.email-queue-process-confirm-meta strong {
    color: #64748b;
    font-weight: 700;
}

.email-queue-process-confirm-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

@media (max-width: 980px) {
    .email-queue-status-grid,
    .email-queue-toolbar,
    .email-queue-detail-body {
        grid-template-columns: 1fr;
    }

    .email-queue-detail-card {
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
        margin: 12px auto;
    }
}

.process-log-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1050;
}

.process-log-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.process-log-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 92vw);
    background: #ffffff;
    box-shadow: -20px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(105%);
    transition: transform 0.3s ease;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e5e7eb;
}

.process-log-drawer.open {
    transform: translateX(0);
}

body.process-log-open {
    overflow: hidden;
}

.process-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 14px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.process-log-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.process-log-header p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

.process-log-actions {
    display: flex;
    gap: 6px;
}

.process-log-filters {
    padding: 16px 20px 8px;
    border-bottom: 1px solid #eef2f7;
    background: #f9fafb;
}

.process-log-filters .filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.process-log-filters .filter-row-actions {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.process-log-filters .filter-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
    letter-spacing: 0.08em;
}

.process-log-filters .filter-actions {
    display: flex;
    justify-content: flex-end;
}

.process-log-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: #475569;
    border-bottom: 1px solid #eef2f7;
    background: #ffffff;
}

.process-log-summary #process-log-count {
    font-weight: 700;
    color: #1d4ed8;
}

.process-log-table-wrapper {
    flex: 1;
    overflow: auto;
    padding: 0 20px 20px;
}

.process-log-list {
    flex: 1;
    overflow: auto;
    padding: 12px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.process-log-item {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid #eef2f7;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.process-log-item .log-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.process-log-item .log-module {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.process-log-item .log-time {
    font-size: 0.75rem;
    color: #64748b;
}

.process-log-item .log-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    font-size: 0.82rem;
    color: #334155;
}

.process-log-item .log-detail span {
    display: block;
    color: #0f172a;
    font-weight: 600;
    margin-top: 2px;
}

.process-log-item .log-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #1d4ed8;
}

.process-log-empty {
    padding: 20px;
    border: 1px dashed #cbd5f5;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-size: 0.85rem;
}

/* User Management Log Drawer */
.user-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.user-section-header .section-title p {
    margin-bottom: 0;
}

.user-log-toggle {
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.user-log-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1050;
}

.user-log-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.user-log-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 92vw);
    background: #ffffff;
    box-shadow: -20px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(105%);
    z-index: 1055;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e5e7eb;
}

.user-log-drawer.open {
    transform: translateX(0);
}

body.user-log-open {
    overflow: hidden;
}

.user-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 14px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
}

.user-log-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.user-log-header p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

.user-log-actions {
    display: flex;
    gap: 6px;
}

.user-log-filters {
    padding: 16px 20px 8px;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
}

.user-log-filters .filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.user-log-filters .filter-row-actions {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.user-log-filters .filter-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
    letter-spacing: 0.08em;
}

.user-log-filters .filter-actions {
    display: flex;
    justify-content: flex-end;
}

.user-log-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: #475569;
    border-bottom: 1px solid #eef2f7;
    background: #ffffff;
}

.user-log-summary #user-log-count {
    font-weight: 700;
    color: #4f46e5;
}

.user-log-list {
    flex: 1;
    overflow: auto;
    padding: 12px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-log-item {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid #eef2f7;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.user-log-item .log-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-log-item .log-module {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.user-log-item .log-time {
    font-size: 0.75rem;
    color: #64748b;
}

.user-log-item .log-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    font-size: 0.82rem;
    color: #334155;
}

.user-log-item .log-detail span {
    display: block;
    color: #0f172a;
    font-weight: 600;
    margin-top: 2px;
}

.user-log-item .log-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
}

.user-log-item .log-chip.type-manager {
    background: #dcfce7;
    color: #166534;
}

.user-log-item .log-chip.type-regular-user {
    background: #e0f2fe;
    color: #075985;
}

.user-log-item .log-chip.type-department {
    background: #fff7ed;
    color: #9a3412;
}

.user-log-empty {
    padding: 20px;
    border: 1px dashed #cbd5f5;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .process-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .process-log-filters .filter-row,
    .process-log-filters .filter-row-actions {
        grid-template-columns: 1fr;
    }

    .process-log-drawer {
        width: 100%;
    }

    .user-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-log-filters .filter-row,
    .user-log-filters .filter-row-actions {
        grid-template-columns: 1fr;
    }

    .user-log-drawer {
        width: 100%;
    }
}

/* Process Form Tags Styles */
.process-tab-content .form-tags-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.process-tab-content .tags-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.process-tab-content .tags-category {
    margin-bottom: 20px;
}

.process-tab-content .tags-category h6 {
    color: #495057;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.process-tab-content .tag-item {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.process-tab-content .tag-item:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.process-tab-content .tag-item.selected {
    border-color: #007bff;
    background: #007bff;
    color: #fff;
}

.process-tab-content .tag-name {
    font-weight: 500;
    display: block;
}

.process-tab-content .tag-value {
    font-size: 0.85em;
    opacity: 0.7;
    display: block;
    margin-top: 2px;
}

.process-tab-content .selected-tags {
    min-height: 100px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.process-tab-content .selected-tag-badge {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px;
    font-size: 0.85em;
}

.process-tab-content .selected-tag-badge .tag-path {
    font-size: 0.75em;
    opacity: 0.8;
    margin-left: 5px;
}

.process-tab-content .form-tag-field {
    position: relative;
    margin-bottom: 15px;
}

.process-tab-content .form-field-actions {
    position: absolute;
    right: 0;
    top: 0;
}

.process-tab-content .default-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

/* Process Line Items Table */
.process-tab-content .line-items-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .process-tab-content .form-tags-container {
        grid-template-columns: 1fr;
    }

    .process-tab-content .default-fields-grid {
        grid-template-columns: 1fr;
    }

    .process-tab-header {
        flex-direction: column;
    }

    .process-tab-btn {
        text-align: left;
        border-bottom: 1px solid #dee2e6;
        border-left: 3px solid transparent;
    }

    .process-tab-btn.active {
        border-left-color: #007bff;
        border-bottom-color: #dee2e6;
    }
}

/* Create Field Section Styles */
.create-field-section {
    background: #e8f5e8;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

.create-field-section .btn {
    background: #28a745;
    border-color: #28a745;
    font-weight: 500;
}

.create-field-section .btn:hover {
    background: #218838;
    border-color: #1e7e34;
}

/* Selected Fields Section */
.selected-fields-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.selected-fields-section h6 {
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Selected Tags Styling */
.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 50px;
    align-items: flex-start;
}

.selected-tag-item {
    background: white;
    border: 1px solid #007bff;
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tag-label {
    font-weight: 500;
    color: #007bff;
}

.tag-path {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 10px;
}

.remove-tag-btn {
    padding: 2px 6px;
    border: none;
    background: none;
    color: #dc3545;
    cursor: pointer;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-tag-btn:hover {
    background: #dc3545;
    color: white;
}

/* Custom Fields Section */
.custom-fields-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.custom-fields-section h6 {
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Form Field Groups */
.form-field-group {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.form-field-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

/* Form Builder Layout */
.form-builder {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

/* No Fields Message */
.no-tags-message {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

/* Form Preview Styles */
.form-preview-container {
    max-height: 400px;
    overflow-y: auto;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f8f9fa;
}

.preview-row:last-child {
    border-bottom: none;
}

.preview-label {
    font-weight: 500;
    color: #495057;
}

.preview-value {
    color: #6c757d;
    max-width: 60%;
    word-break: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-tags-container {
        grid-template-columns: 1fr;
    }

    .selected-tag-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .form-builder-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .default-fields-grid {
        grid-template-columns: 1fr;
    }
}

.badge {
    font-size: 0.7em;
    padding: 0.25em 0.5em;
}

.assignment-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #28a745;
    border-radius: 4px;
    padding: 12px 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* Keyword Management Modal Styles */


/* Category Title Enhancements */
.category-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin: 1rem 0 0.5rem 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Builder Enhancements */
.form-builder-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 0.375rem 0.375rem 0 0;
}

.form-builder-header h5 {
    margin: 0;
    color: #495057;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-tags-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-tags-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .assignment-toast {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .form-actions {
        flex-direction: column;
    }

    .keyword-field-section {
        padding: 1rem !important;
    }
}

/* Loading States */
#process-keyword-management-container .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Badge Variants */
.badge.bg-light.text-dark {
    border: 1px solid #dee2e6;
}

/* Modal Footer Enhancements */
#process-keyword-management-modal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    background: #f8f9fa;
}

/* Create Field Modal Enhancements */
#process-create-field-modal .form-group {
    margin-bottom: 1rem;
}

#process-create-field-modal .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

#process-create-field-modal .form-text {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Default Fields Section Styling */
.default-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.default-fields-section .form-group {
    margin-bottom: 0;
}

.default-fields-section .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.default-fields-section .form-control[readonly] {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #495057;
}

.default-fields-section .form-control.ai-filled[readonly] {
    background-color: #ecfeff;
    border-color: #67e8f9;
    box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.15);
}

/* Custom Form Fields Section */
.custom-fields-section {
    border-top: 2px solid #e9ecef;
    padding-top: 1.5rem;
}

.custom-fields-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Alert Info Enhancement */
.alert-info {
    background: #d1edff;
    border-color: #b6d7ff;
    color: #055160;
}

.alert-info .fas.fa-info-circle {
    color: #0dcaf0;
}



/* Edit Icon Styling */
.edit-icon {
    margin-left: 8px;
    cursor: pointer;
    color: #6c757d;
    font-size: 12px;
    transition: color 0.2s;
    opacity: 0.6;
}

.edit-icon:hover {
    color: #0d6efd;
    opacity: 1;
}

.input-with-edit {
    position: relative;
}

.default-field.editable,
.default-field.editing {
    background-color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Default Fields Grid */
.default-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Save/Cancel Button Styling */
.field-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.save-btn,
.cancel-btn {
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
}

.save-btn {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.save-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.cancel-btn {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.cancel-btn:hover {
    background-color: #c82333;
    border-color: #bd2130;
}


/* Extraction Results Styles */
.view-toggle {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.view-toggle .btn {
    border-radius: 4px;
    font-size: 12px;
}

.view-content {
    display: none;
    margin-top: 20px;
}

.view-content.active {
    display: block;
}

/* Preview View Styles */
.preview-wrapper {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.preview-section {
    margin-bottom: 5px;
}

.preview-section-header {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.preview-section-header:hover {
    background: #dee2e6;
}

.toggle-icon {
    width: 20px;
    text-align: center;
}

.section-title {
    font-weight: 600;
    color: #212529;
}

.section-type {
    font-size: 11px;
    color: #6c757d;
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: auto;
}

.preview-section-content {
    padding: 10px 0 10px 30px;
    border-left: 2px solid #dee2e6;
    margin-left: 10px;
}

.preview-row {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
    border-bottom: 1px solid #f1f1f1;
}

.preview-key {
    min-width: 200px;
    font-weight: 600;
    color: #495057;
    padding-right: 15px;
}

.preview-value {
    flex: 1;
    color: #212529;
    word-break: break-word;
}

/* All Data View Styles */

/* Gmail Compose Modal */
.gmail-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.gmail-modal.show {
    display: flex;
}

.gmail-modal-content {
    width: min(520px, 92vw);
    background: white;
    border-radius: 16px;
    padding: 20px 24px 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.gmail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.gmail-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.gmail-close {
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
}

.gmail-modal-content label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin: 12px 0 6px;
    color: #4b5563;
}

.gmail-modal-content input,
.gmail-modal-content textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}

.gmail-modal-content textarea {
    resize: vertical;
}

.gmail-file-list {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.gmail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.gmail-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.gmail-secondary {
    background: #f3f4f6;
    color: #111827;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
}

.gmail-status {
    margin-top: 12px;
    font-size: 13px;
    color: #2563eb;
}

.gmail-status.error {
    color: #dc2626;
}

.gmail-status.success {
    color: #16a34a;
}
.structured-data-wrapper {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.data-section {
    margin-bottom: 8px;
}

.data-section-header {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dee2e6;
}

.data-section-header:hover {
    background: #e9ecef;
}

.data-section-content {
    padding: 10px 0 10px 25px;
    margin-left: 10px;
}

.data-row {
    display: flex;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

.data-key {
    min-width: 250px;
    font-weight: 600;
    color: #495057;
    padding-right: 15px;
}

.data-value {
    flex: 1;
    color: #212529;
    word-break: break-word;
    padding-left: 10px;
    border-left: 2px solid #e9ecef;
}

/* Loading States */
.preview-loading,
.all-data-loading {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

/* JSON Viewer Styles */
.json-viewer {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.json-viewer pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .view-toggle {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle .btn {
        width: 100%;
        margin-bottom: 5px;
    }

    .preview-key,
    .data-key {
        min-width: 150px;
    }
}

/* Reset Password Modal */
body.modal-open {
    overflow: hidden;
}

.reset-password-modal {
    position: fixed;
    inset: 0;
    z-index: 2005;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-password-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.88));
    backdrop-filter: blur(6px);
}

.reset-password-card {
    position: relative;
    width: 560px;
    max-width: 92vw;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    animation: resetSlideIn 0.2s ease-out;
}

@keyframes resetSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reset-password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #764ba2, #1e293b);
    color: #f8fafc;
}

.reset-password-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.reset-password-subtitle {
    font-size: 13px;
    color: rgba(248, 250, 252, 0.72);
}

.reset-password-close {
    border: none;
    background: rgba(248, 250, 252, 0.12);
    color: #f8fafc;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.reset-password-close:hover {
    background: rgba(248, 250, 252, 0.2);
}

.reset-password-steps {
    display: flex;
    gap: 16px;
    padding: 14px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.reset-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #64748b;
}

.reset-step .step-circle {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #cbd5f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #475569;
}

.reset-step.active {
    color: #0f172a;
    font-weight: 600;
}

.reset-step.active .step-circle {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.reset-password-body {
    padding: 20px 24px 24px;
    display: grid;
    gap: 18px;
}

.reset-step-panel {
    display: none;
    animation: resetFadeIn 0.2s ease-out;
}

.reset-step-panel.active {
    display: block;
}

@keyframes resetFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reset-field {
    display: grid;
    gap: 8px;
}

.reset-field label {
    font-weight: 600;
    color: #1e293b;
}

.reset-input-group {
    position: relative;
}

.reset-input-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.reset-input-group input {
    padding-left: 36px;
    padding-right: 42px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

.reset-input-group input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.reset-visibility {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #64748b;
    padding: 4px;
}

.reset-hint {
    font-size: 12px;
    color: #64748b;
}

.reset-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.reset-primary {
    background: linear-gradient(135deg, #891bb8, #891bb8);
    color: #ffffff;
    border: none;
    box-shadow: 0 12px 24px rgba(14, 165, 233, 0.28);
}

.reset-primary:hover {
    filter: brightness(0.98);
}

.reset-primary:disabled {
    opacity: 0.6;
    box-shadow: none;
}

.reset-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
}

.reset-strength-bar {
    position: relative;
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.reset-strength-fill {
    height: 100%;
    width: 0;
    background: #f97316;
    transition: width 0.2s ease, background 0.2s ease;
}

.reset-strength-fill[data-score="0"] {
    background: #e2e8f0;
}

.reset-strength-fill[data-score="1"] {
    background: #f97316;
}

.reset-strength-fill[data-score="2"] {
    background: #f59e0b;
}

.reset-strength-fill[data-score="3"] {
    background: #22c55e;
}

.reset-strength-fill[data-score="4"] {
    background: #16a34a;
}

@media (max-width: 640px) {
    .reset-password-card {
        width: 95vw;
    }

    .reset-actions {
        flex-direction: column;
    }

    .reset-actions .btn,
    .reset-actions .reset-primary {
        width: 100%;
    }
}

.comment-section {
    margin-top: 16px;
}

.comment-section.comment-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.comment-section.comment-card h6 {
    margin-bottom: 10px;
}

.comment-section textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

.comment-section small {
    display: block;
    margin-top: 6px;
}

.log-comment-block {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.log-comment-block .log-label {
    display: block;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}
/* Process Document OCR recovery and contained Form Builder scrolling */
#document-form-layout .form-builder-container {
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#document-form-layout .form-builder-header {
    position: sticky;
    top: 0;
    z-index: 30;
}

#document-form-layout .default-fields-section,
#document-form-layout .custom-fields-section,
#document-form-layout .selected-fields-section,
#document-form-layout .unmapped-ocr-section {
    overflow: visible;
    flex-shrink: 0;
}

#document-form-layout .default-fields-section > h6,
#document-form-layout .custom-fields-section > h6,
#document-form-layout .selected-fields-section > h6,
#document-form-layout .process-section-title {
    position: sticky;
    top: 64px;
    z-index: 20;
    background: #fff;
    padding: 8px 0;
}

.unmapped-ocr-section {
    display: none;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.process-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.process-section-title h6 {
    margin: 0;
}

.process-section-title span {
    color: #6c757d;
    font-size: 0.8rem;
}

.unmapped-ocr-list {
    display: grid;
    gap: 10px;
}

.unmapped-ocr-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
}

.unmapped-ocr-copy {
    min-width: 0;
}

.unmapped-ocr-copy strong,
.unmapped-ocr-copy span {
    display: block;
    overflow-wrap: anywhere;
}

.unmapped-ocr-copy strong {
    color: #334155;
    font-size: 0.78rem;
}

.unmapped-ocr-copy span {
    color: #111827;
    font-size: 0.9rem;
}

.unmapped-ocr-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.unmapped-ocr-actions .form-select {
    width: 180px;
}

#process-refresh-autofill {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .unmapped-ocr-item {
        grid-template-columns: 1fr;
    }

    .unmapped-ocr-actions,
    .unmapped-ocr-actions .form-select {
        width: 100%;
    }
}

/* Dashboard theme alignment for Process Document and Report Center */
#process-document-section,
.report-section {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 26rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

#process-document-section .process-section-header {
    margin-bottom: 1.2rem;
    padding: 1rem 1rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

#process-document-section .section-title h2 {
    color: #0f172a;
    font-weight: 700;
    letter-spacing: -0.03em;
}

#process-document-section .section-title h2 i {
    color: #2563eb;
}

#process-document-section .section-title p {
    color: #64748b;
}

#process-document-section .process-log-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.24);
    color: #1d4ed8;
    border-radius: 0.8rem;
    font-weight: 700;
}

#process-document-section.email-queue-open .process-log-toggle {
    display: none !important;
}

#process-document-section .process-queue-toggle {
    position: absolute;
    top: 20px;
    right: 96px;
    border-radius: 0.8rem;
}

#process-document-section .process-queue-toggle.is-hidden {
    display: none !important;
}

#process-document-section .process-document-tabs {
    border-radius: 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

#process-document-section .process-tab-header {
    background: #f8fafc;
    border-bottom-color: rgba(148, 163, 184, 0.18);
    gap: 0.5rem;
    padding: 0.75rem;
}

#process-document-section .process-tab-btn {
    border: 1px solid transparent;
    border-radius: 0.85rem;
    color: #475569;
    font-weight: 700;
    padding: 0.72rem 1rem;
}

#process-document-section .process-tab-btn:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
}

#process-document-section .process-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

#process-document-section .process-tab-content {
    background: #ffffff;
}

#process-document-section .upload-section,
#process-document-section .form-builder-container,
#process-document-section .line-items-section {
    border-color: rgba(148, 163, 184, 0.28);
    border-radius: 1rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

#process-document-section .btn-primary,
.report-section .btn-primary,
.report-section .btn-dark {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.report-section {
    padding: 1rem 1rem 2rem;
}

.report-hero {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 45%, rgba(91, 33, 182, 0.94) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.4rem;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    color: #eef2ff;
    position: relative;
    overflow: hidden;
}

.report-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.18), transparent 24rem),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07));
    pointer-events: none;
}

.report-hero > * {
    position: relative;
    z-index: 1;
}

.report-hero h2 {
    font-weight: 850;
    letter-spacing: -0.03em;
}

.report-hero p {
    color: rgba(226, 232, 240, 0.82);
}

.report-meta-item {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.report-meta-item .label {
    color: rgba(226, 232, 240, 0.72);
}

.report-filter-card,
.report-panel,
.report-card,
.report-kpi {
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.report-filter-card,
.report-panel,
.report-card {
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.98);
}

.report-range-btn,
.report-tab {
    border-radius: 0.85rem;
    font-weight: 800;
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #f8fafc;
}

.report-range-btn:hover,
.report-tab:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
}

.report-range-btn.active,
.report-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.report-tabs {
    gap: 0.55rem;
}

.report-panel-header {
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

.report-panel-header h3,
.report-card h4 {
    color: #0f172a;
    font-weight: 850;
}

.report-panel-header p,
.report-kpi .label,
.report-kpi .meta {
    color: #64748b;
}

.report-kpi {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 1rem;
}

.report-kpi .value {
    color: #0f172a;
    font-weight: 850;
}

.report-section select,
.report-section input[type="date"] {
    border-color: rgba(148, 163, 184, 0.36);
    border-radius: 0.75rem;
}

.report-section select:focus,
.report-section input[type="date"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12);
    outline: none;
}

.report-table table thead th {
    background: #f8fafc;
    color: #475569;
    border-bottom-color: rgba(148, 163, 184, 0.24);
}

.delegation-name-old {
    color: #dc2626;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    font-weight: 800;
}

.delegation-name-old::before {
    content: "● ";
    text-decoration: none;
}

.delegation-name-new {
    color: #15803d;
    font-weight: 900;
}

.delegation-name-new::before {
    content: "● ";
}

.delegation-badge-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.delegation-badge,
.delegation-timeline-badge {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #14532d;
    border-radius: 12px;
    padding: 10px 12px;
    display: grid;
    gap: 5px;
    font-size: 0.82rem;
}

.delegation-badge strong,
.delegation-timeline-badge strong {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    background: #16a34a;
    color: #ffffff;
    padding: 4px 9px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.log-chip-delegated-old {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.log-chip-delegated-new {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.timeline-item.timeline-delegated .timeline-marker {
    background: #16a34a !important;
}

.timeline-item.timeline-assigned .timeline-marker {
    background: #2563eb !important;
}

/* Full-screen OCR processing overlay */
#process-document-section {
    position: relative;
}

#process-document-section.ocr-processing-section-active > :not(.ocr-processing-overlay) {
    filter: blur(2.5px) saturate(0.92);
    pointer-events: none;
    user-select: none;
}

.ocr-processing-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 250px;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transform: translateY(-6vh);
    background:
        radial-gradient(circle at 25% 20%, rgba(45, 212, 191, 0.22), transparent 32%),
        radial-gradient(circle at 78% 18%, rgba(124, 58, 237, 0.22), transparent 30%),
        rgba(15, 23, 42, 0.38);
    backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

body:has(.sidebar.collapsed) .ocr-processing-overlay {
    left: 88px;
}

@media (max-width: 1024px) {
    .ocr-processing-overlay {
        left: 240px;
    }

    body:has(.sidebar.collapsed) .ocr-processing-overlay {
        left: 88px;
    }
}

@media (max-width: 768px) {
    .ocr-processing-overlay,
    body:has(.sidebar.collapsed) .ocr-processing-overlay {
        left: 0;
    }
}

.ocr-processing-overlay.is-active,
.ocr-processing-overlay.is-failure {
    opacity: 1;
    visibility: visible;
}

.ocr-processing-overlay.is-hiding {
    opacity: 0;
    visibility: hidden;
}

.ocr-processing-card {
    width: min(430px, 90vw);
    min-height: 430px;
    position: relative;
    pointer-events: auto;
    overflow: hidden;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 26px;
    padding: 1.55rem 1.65rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.95));
    box-shadow: 0 30px 90px rgba(2, 6, 23, 0.35);
}

.ocr-processing-card::before {
    content: '';
    position: absolute;
    inset: -35% -20% auto;
    height: 190px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.18), rgba(139, 92, 246, 0.16), rgba(20, 184, 166, 0.18));
    transform: rotate(-8deg);
}

.ocr-animation-stage {
    position: relative;
    height: 178px;
    margin-bottom: 0.7rem;
    display: grid;
    place-items: center;
    transform: scale(0.78);
}

.ocr-overlay-kicker {
    position: relative;
    display: inline-flex;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ocr-processing-card h3 {
    position: relative;
    margin: 0.7rem 0 0.45rem;
    color: #0f172a;
    font-size: 1.18rem;
    font-weight: 800;
}

.ocr-processing-card p {
    position: relative;
    min-height: 2.6rem;
    margin: 0 auto;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 410px;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.ocr-processing-card p.is-changing {
    opacity: 0;
    transform: translateY(6px);
}

.ocr-progress-track {
    position: relative;
    height: 8px;
    max-width: 270px;
    margin: 0.85rem auto 0.65rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
}

.ocr-progress-track span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6, #14b8a6);
    animation: ocr-progress-scan 1.65s ease-in-out infinite;
}

.ocr-progress-dots {
    display: inline-flex;
    gap: 0.45rem;
}

.ocr-progress-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #0ea5e9;
    animation: ocr-dot-pulse 1.1s ease-in-out infinite;
}

.ocr-progress-dots span:nth-child(2) {
    animation-delay: 0.18s;
    background: #8b5cf6;
}

.ocr-progress-dots span:nth-child(3) {
    animation-delay: 0.36s;
    background: #14b8a6;
}

.ocr-overlay-retry {
    margin-top: 1rem;
    border-radius: 999px;
    font-weight: 800;
}

.ocr-overlay-retry[hidden] {
    display: none !important;
}

.ocr-robot-scene,
.ocr-reader-scene,
.ocr-failure-scene {
    position: relative;
    width: 260px;
    height: 215px;
}

.ocr-floating-paper,
.ocr-reader-document,
.ocr-failure-paper {
    position: absolute;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.ocr-floating-paper {
    left: 12px;
    top: 32px;
    width: 112px;
    height: 145px;
    animation: ocr-paper-float 3s ease-in-out infinite;
}

.ocr-floating-paper::before,
.ocr-reader-document::before,
.ocr-failure-paper::before {
    content: '';
    position: absolute;
    inset: 12px 14px auto;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
}

.ocr-floating-paper span,
.ocr-reader-document span,
.ocr-failure-paper span {
    position: absolute;
    left: 16px;
    right: 16px;
    height: 7px;
    border-radius: 999px;
    background: #dbeafe;
}

.ocr-floating-paper span:nth-child(1),
.ocr-reader-document span:nth-child(1),
.ocr-failure-paper span:nth-child(1) {
    top: 48px;
}

.ocr-floating-paper span:nth-child(2),
.ocr-reader-document span:nth-child(2),
.ocr-failure-paper span:nth-child(2) {
    top: 72px;
    right: 34px;
}

.ocr-floating-paper span:nth-child(3),
.ocr-reader-document span:nth-child(3),
.ocr-failure-paper span:nth-child(3) {
    top: 96px;
}

.ocr-robot {
    position: absolute;
    right: 16px;
    top: 44px;
    width: 110px;
    height: 138px;
    animation: ocr-robot-bob 2.4s ease-in-out infinite;
}

.ocr-robot-antenna {
    position: absolute;
    left: 52px;
    top: -18px;
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: #334155;
}

.ocr-robot-antenna::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 18px #22c55e;
}

.ocr-robot-head {
    width: 92px;
    height: 64px;
    margin: 0 auto;
    border-radius: 22px;
    background: linear-gradient(145deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.24);
}

.ocr-robot-eye {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #67e8f9;
    box-shadow: 0 0 18px #22d3ee;
    animation: ocr-eye-blink 2.8s infinite;
}

.ocr-robot-body {
    width: 80px;
    height: 62px;
    margin: 10px auto 0;
    display: grid;
    place-items: center;
    border-radius: 24px;
    color: #0f766e;
    background: linear-gradient(145deg, #ccfbf1, #ffffff);
    border: 1px solid rgba(20, 184, 166, 0.35);
}

.ocr-vacuum-nozzle {
    position: absolute;
    left: -54px;
    top: 92px;
    width: 92px;
    height: 28px;
    border-radius: 999px 12px 12px 999px;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.16), rgba(14, 165, 233, 0.8));
}

.ocr-vacuum-nozzle::before {
    content: '';
    position: absolute;
    left: -72px;
    top: 50%;
    width: 76px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0ea5e9);
    box-shadow: 0 -14px 0 rgba(14, 165, 233, 0.45), 0 14px 0 rgba(14, 165, 233, 0.45);
    animation: ocr-vacuum-flow 1s linear infinite;
}

.ocr-data-stream {
    position: absolute;
    left: 50px;
    bottom: 2px;
    display: flex;
    gap: 8px;
}

.ocr-data-stream span {
    padding: 0.25rem 0.45rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    font-size: 0.7rem;
    font-weight: 800;
    animation: ocr-token-rise 1.8s ease-in-out infinite;
}

.ocr-data-stream span:nth-child(2) { animation-delay: 0.2s; }
.ocr-data-stream span:nth-child(3) { animation-delay: 0.4s; }
.ocr-data-stream span:nth-child(4) { animation-delay: 0.6s; }

.ocr-reader-character {
    position: absolute;
    left: 35px;
    top: 38px;
    width: 92px;
    height: 150px;
    animation: ocr-reader-nod 2.4s ease-in-out infinite;
}

.ocr-reader-hair {
    position: absolute;
    left: 15px;
    top: 0;
    width: 62px;
    height: 42px;
    border-radius: 50% 50% 28% 28%;
    background: #334155;
}

.ocr-reader-face {
    position: absolute;
    left: 12px;
    top: 20px;
    width: 68px;
    height: 62px;
    border-radius: 26px;
    background: #fed7aa;
}

.ocr-reader-glass {
    position: absolute;
    top: 22px;
    width: 22px;
    height: 16px;
    border: 3px solid #0f172a;
    border-radius: 50%;
}

.ocr-reader-glass.left { left: 10px; }
.ocr-reader-glass.right { right: 10px; }

.ocr-reader-body {
    position: absolute;
    left: 6px;
    bottom: 0;
    width: 80px;
    height: 72px;
    border-radius: 28px 28px 18px 18px;
    background: linear-gradient(145deg, #8b5cf6, #2563eb);
}

.ocr-reader-document {
    right: 26px;
    top: 42px;
    width: 110px;
    height: 136px;
    transform: rotate(5deg);
}

.ocr-reader-magnifier {
    position: absolute;
    right: 82px;
    top: 94px;
    width: 54px;
    height: 54px;
    border: 6px solid rgba(14, 165, 233, 0.8);
    border-radius: 50%;
    animation: ocr-magnifier-scan 2.1s ease-in-out infinite;
}

.ocr-reader-magnifier::after {
    content: '';
    position: absolute;
    right: -24px;
    bottom: -17px;
    width: 38px;
    height: 7px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.8);
    transform: rotate(45deg);
}

.ocr-warning-orb {
    position: absolute;
    left: 78px;
    top: 22px;
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #b45309;
    font-size: 2.3rem;
    background: radial-gradient(circle, #fef3c7, #fed7aa);
    box-shadow: 0 18px 40px rgba(180, 83, 9, 0.18);
    animation: ocr-warning-pop 1.2s ease-in-out infinite;
}

.ocr-failure-paper {
    left: 74px;
    bottom: 10px;
    width: 116px;
    height: 86px;
    transform: rotate(-3deg);
}

@keyframes ocr-progress-scan {
    0% { transform: translateX(-110%); }
    50% { transform: translateX(82%); }
    100% { transform: translateX(260%); }
}

@keyframes ocr-dot-pulse {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-7px); opacity: 1; }
}

@keyframes ocr-paper-float {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes ocr-robot-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes ocr-eye-blink {
    0%, 88%, 100% { transform: scaleY(1); }
    92% { transform: scaleY(0.15); }
}

@keyframes ocr-vacuum-flow {
    from { transform: translateX(0); opacity: 0.25; }
    to { transform: translateX(34px); opacity: 1; }
}

@keyframes ocr-token-rise {
    0%, 100% { transform: translateY(0); opacity: 0.55; }
    50% { transform: translateY(-12px); opacity: 1; }
}

@keyframes ocr-reader-nod {
    0%, 100% { transform: rotate(0); }
    50% { transform: rotate(2deg) translateY(4px); }
}

@keyframes ocr-magnifier-scan {
    0%, 100% { transform: translate(-16px, -8px); }
    50% { transform: translate(22px, 16px); }
}

@keyframes ocr-warning-pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

@media (max-width: 640px) {
    .ocr-processing-card {
        min-height: 480px;
        padding: 1.6rem 1.2rem;
        border-radius: 24px;
    }

    .ocr-animation-stage {
        transform: scale(0.88);
        height: 205px;
    }
}

.email-queue-batch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin: 10px 0;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
}

.email-queue-batch-toolbar.is-hidden {
    display: none;
}

.email-queue-batch-toolbar strong,
.email-queue-batch-toolbar span {
    display: block;
}

.email-queue-batch-toolbar span {
    color: #475569;
    font-size: 0.78rem;
}

.email-queue-batch-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.email-queue-icon-btn {
    width: 38px;
    min-width: 38px;
    padding-left: 0;
    padding-right: 0;
    display: inline-grid;
    place-items: center;
}

.email-queue-processing-mode-card {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
}

.email-queue-processing-mode-card span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.email-queue-processing-mode-card strong {
    display: block;
    margin-top: 4px;
    color: #0f172a;
}

.email-queue-processing-mode-card em {
    font-style: normal;
    color: #2563eb;
}

.email-queue-select-head,
.email-queue-select-cell {
    width: 42px;
    text-align: center;
}

.email-queue-table tr.is-selected td {
    background: #eff6ff;
}

.email-queue-status-badge.is-processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.email-queue-status-badge.is-exception {
    background: #fee2e2;
    color: #991b1b;
}

.email-queue-batch-progress {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1200;
    display: block;
    touch-action: none;
}

.email-queue-batch-progress.is-hidden {
    display: none;
}

.email-queue-batch-progress-toggle {
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.34);
    display: grid;
    place-items: center;
    position: relative;
}

.email-queue-batch-progress-toggle span {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 34px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.email-queue-batch-progress-panel {
    width: 360px;
    padding: 14px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    display: block;
}

.email-queue-batch-progress.is-expanded .email-queue-batch-progress-panel {
    display: block;
}

.email-queue-batch-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    cursor: move;
    user-select: none;
}

.email-queue-batch-progress-head strong,
.email-queue-batch-progress-head span {
    display: block;
}

.email-queue-batch-progress-head span {
    color: #64748b;
    font-size: 0.78rem;
}

.email-queue-batch-progress-head button {
    width: 30px;
    height: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
}

.email-queue-batch-progress-close {
    display: inline-grid;
    place-items: center;
    font-size: 1rem;
}

.email-queue-batch-progress-close.is-hidden {
    display: none;
}

.email-queue-batch-progress.is-complete .email-queue-batch-progress-close,
.email-queue-batch-progress.is-failed .email-queue-batch-progress-close {
    border-color: #fecaca;
    background: #fee2e2;
    color: #b91c1c;
    box-shadow: 0 8px 18px rgba(185, 28, 28, 0.16);
}

.email-queue-batch-progress.is-dragging {
    cursor: move;
    opacity: 0.96;
}

.email-queue-batch-progress-bar {
    height: 8px;
    margin: 12px 0;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

.email-queue-batch-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #22c55e;
    transition: width 0.25s ease;
}

.email-queue-batch-progress-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.email-queue-batch-progress-stats span {
    padding: 8px;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    text-align: center;
}

.email-queue-batch-progress-stats strong {
    display: block;
    color: #0f172a;
    font-size: 1rem;
}

.email-queue-batch-current {
    margin-top: 10px;
    color: #334155;
    font-size: 0.82rem;
    white-space: normal;
    word-break: break-word;
}

.email-queue-batch-summary-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.email-queue-batch-summary-modal.is-open {
    display: flex;
}

.email-queue-batch-summary-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.email-queue-batch-summary-card {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    padding: 18px;
}

.email-queue-batch-summary-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.email-queue-batch-summary-head h4 {
    margin: 0 0 4px;
    color: #0f172a;
}

.email-queue-batch-summary-head p {
    margin: 0;
    color: #64748b;
}

.email-queue-batch-summary-head button {
    border: 0;
    background: transparent;
    color: #475569;
}

.email-queue-batch-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.email-queue-batch-summary-grid span {
    padding: 10px;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
}

.email-queue-batch-summary-grid strong {
    display: block;
    color: #0f172a;
    font-size: 1.1rem;
}

.email-queue-batch-summary-list {
    border-top: 1px solid #e5e7eb;
}

.email-queue-batch-summary-list div,
.email-queue-batch-summary-list p {
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.email-queue-batch-summary-list strong,
.email-queue-batch-summary-list span {
    display: block;
}

.email-queue-batch-summary-list span {
    color: #64748b;
    font-size: 0.8rem;
}

.email-queue-batch-summary-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.email-queue-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1350;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.email-queue-settings-modal.is-open {
    display: flex;
}

.email-queue-settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.email-queue-settings-card {
    position: relative;
    width: min(620px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    padding: 18px;
}

.email-queue-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.email-queue-settings-head h4 {
    margin: 0 0 4px;
    color: #0f172a;
}

.email-queue-settings-head p {
    margin: 0;
    color: #64748b;
}

.email-queue-settings-head button {
    border: 0;
    background: transparent;
    color: #475569;
}

.email-queue-settings-tabs {
    display: flex;
    gap: 6px;
    margin: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.email-queue-settings-tabs button {
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #64748b;
    padding: 10px 12px;
    font-weight: 800;
}

.email-queue-settings-tabs button.is-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.email-queue-settings-pane {
    display: none;
}

.email-queue-settings-pane.is-active {
    display: grid;
    gap: 12px;
}

.email-queue-settings-pane label {
    color: #0f172a;
    font-weight: 700;
}

.email-queue-settings-pane input[type="radio"] {
    margin-right: 8px;
}

.email-queue-settings-field {
    display: grid;
    gap: 6px;
}

.email-queue-settings-field.is-hidden {
    display: none;
}

.email-queue-settings-field span,
.email-queue-settings-current span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.email-queue-settings-field select,
.email-queue-settings-field input {
    min-height: 38px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 7px 10px;
}

.email-queue-settings-current {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
}

.email-queue-settings-current strong,
.email-queue-settings-current p {
    display: block;
    margin: 4px 0 0;
}

.email-queue-settings-current p {
    color: #64748b;
}

.email-queue-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

@media (max-width: 720px) {
    .email-queue-batch-toolbar,
    .email-queue-batch-summary-actions,
    .email-queue-settings-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .email-queue-settings-tabs {
        overflow-x: auto;
    }

    .email-queue-batch-progress {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }

    .email-queue-batch-progress-panel {
        width: 100%;
    }

    .email-queue-batch-progress-stats,
    .email-queue-batch-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
