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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

header h1 {
    margin-bottom: 15px;
    font-size: 28px;
}

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

.tab-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #333;
    font-size: 24px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

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

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

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

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

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.card-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

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

.badge-destination {
    background: #f3e5f5;
    color: #7b1fa2;
}

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

.badge-inactive {
    background: #ffebee;
    color: #c62828;
}

.badge-pending {
    background: #fff3e0;
    color: #f57c00;
}

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

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

.badge-failed {
    background: #ffebee;
    color: #c62828;
}

.card-content {
    color: #666;
    margin-bottom: 10px;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

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

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    margin-left: 5px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

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

.status-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.status-card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.status-card .value {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
}

.message-item {
    border-left: 4px solid #667eea;
}

.message-item.failed {
    border-left-color: #dc3545;
}

.message-item.sent {
    border-left-color: #28a745;
}

.message-item.processing {
    border-left-color: #ffc107;
}

.message-text {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-meta {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
}

.success {
    background: #e8f5e9;
    color: #388e3c;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
}

.whatsapp-connection-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.whatsapp-connection-section h3 {
    color: #333;
    margin-bottom: 15px;
}

#qr-code-container img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
}

