
/* Status Filter */
.status-filter-container {
    margin-top:1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.status-filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: Inter;
}

.status-filter-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.status-filter-btn.active {
    background: #081e5c;
    color: #ffffff;
    border-color: #081e5c;
}

.filter-count {
    font-size: 0.75rem;
    opacity: 0.8;
}

#smartbox-section .smartbox-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
#smartbox-section .smartbox-table th, .smartbox-table td {
    border: 1px solid #ccc;
    padding: 0.5rem;
    vertical-align: top;
}
#smartbox-section .smartbox-table th {
    background: #f5f5f5;
}

/* Smartbox Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 29, 93, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
}

.modal-box {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    min-width: 320px;
    box-shadow: 0 4px 24px rgba(13, 29, 93, 0.12);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.modal-box h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #081e5c;
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-select {
    padding: 0.7rem;
    border: 1.5px solid #081e5c;
    border-radius: 0.7rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    background: #f9fafb;
}

.modal-btn {
    background-color: #081e5c;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.modal-btn:hover {
    background-color: #7f8899;
}

mark.highlight {
    background: #B2B2DC;
    cursor: pointer;
}

/* Smartbox Cards Layout */
.smartbox-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.smartbox-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.smartbox-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #081e5c;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-date {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.processed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.error {
    background-color: #fee2e2;
    color: #dc2626;
}

.card-sender {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.card-subject {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.card-attachments {
    font-size: 0.875rem;
    color: #6b7280;
}

.card-attachments i {
    margin-right: 0.25rem;
}

/* Mail Details Modal */
.mail-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.mail-details-modal-content {
    background: #fff;
    border-radius: 1rem;
    max-width: 95vw;
    max-height: 95vh;
    width: 1400px;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.mail-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 1rem 1rem 0 0;
}

.mail-details-header h3 {
    margin: 0;
    color: #081e5c;
    font-size: 1.25rem;
    font-weight: 700;
}

.mail-details-header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-delete-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: #dc2626;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    border-radius: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.modal-delete-btn:hover {
    background: #fee2e2;
    color: #991b1b;
}

.mail-details-body {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 2rem;
    padding: 1.5rem;
}

.mail-details-body.single-column {
    grid-template-columns: 1fr;
    gap: 0;
}

.mail-details-left {
    min-width: 0;
}

.mail-details-right {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.mail-meta {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.mail-meta > div {
    margin-bottom: 0.5rem;
}

.mail-meta > div:last-child {
    margin-bottom: 0;
}

.mail-status a {
    color: #081e5c;
    text-decoration: none;
    font-weight: 600;
}

.mail-status a:hover {
    text-decoration: underline;
}

.status-pending {
    color: #92400e;
    font-weight: 600;
}

.status-error {
    color: #dc2626;
    font-weight: 600;
}

.mail-content, .mail-attachments {
    margin-bottom: 1.5rem;
}

/* Workflow Styles */
.workflow-container h4 {
    margin: 0 0 1.5rem 0;
    color: #081e5c;
    font-size: 1.1rem;
    font-weight: 700;
}

.workflow-step {
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
}

.workflow-step-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: 1px solid #e2e8f0;
}

.workflow-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #081e5c;
    color: #fff;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.75rem;
    flex: 0 0 auto;
}

.workflow-step-title {
    font-weight: 600;
    color: #374151;
}

.workflow-step-content {
    padding: 1rem;
}

.workflow-instructions {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.workflow-assignments {
    max-height: 200px;
    overflow-y: auto;
}

.workflow-assignment {
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
}

.workflow-assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.workflow-assignment-text {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.4;
    background: #B2B2DC;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-style: italic;
}

.workflow-assignment-chapter {
    font-size: 0.8rem;
    color: #374151;
    font-weight: 600;
    background: #e2e8f0;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    flex: 1;
    margin-right: 0.5rem;
}

.assignment-delete-btn-small {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    padding: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.assignment-delete-btn-small:hover {
    background: #dc2626;
}

.workflow-no-assignments {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.process-mail-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.process-mail-btn:hover {
    background: #047857;
}

.workflow-processed {
    text-align: center;
    padding: 1rem;
    color: #065f46;
    font-weight: 600;
}

@media (max-width: 768px) {
    .smartbox-cards-container {
        grid-template-columns: 1fr;
    }
    
    .mail-details-modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .mail-details-body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .mail-details-right {
        order: -1;
    }
}

@media (max-width: 1500px) {
    .mail-details-modal-content {
        width: 90vw;
    }
    
    .mail-details-body {
        grid-template-columns: 1fr 400px;
    }
}