:root {
    --primary-color: #2563eb;
    --secondary-color: #f3f4f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --pending-color: #f59e0b;
}

.main-content {
    padding: 16px;
}

.card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #fff;
}

.table {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.table thead th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table td {
    padding: 12px;
    vertical-align: middle;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.badge-status {
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    display: inline-block;
}

.badge-pending {
    background: #fff7ed;
    color: #f59e0b;
}

.badge-active {
    background: #ecfdf5;
    color: #10b981;
}

.badge-inactive {
    background: #fef2f2;
    color: #ef4444;
}

.refcode-badge {
    background: #f8fafc;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    user-select: all;
}

.refcode-badge:hover {
    background: #f1f5f9;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 12px;
    color: #64748b;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 4px 8px;
    margin: 0 2px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #1e293b !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f8fafc !important;
    border-color: #e5e7eb;
    color: #1e293b !important;
}

.btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-right: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-approve {
    background: #10b981;
    color: #fff;
    border: none;
}

.btn-approve:hover {
    background: #059669;
    color: #fff;
}

.btn-reject {
    background: #ef4444;
    color: #fff;
    border: none;
}

.btn-reject:hover {
    background: #dc2626;
    color: #fff;
}

@media (max-width: 768px) {
    .main-content {
        padding: 8px;
    }
    .card {
        margin-bottom: 12px;
        border-radius: 6px;
    }
    .table thead th, .table td {
        padding: 8px;
        font-size: 13px;
    }
    .btn-action {
        padding: 4px 8px;
        font-size: 13px;
    }
    .refcode-badge {
        padding: 3px 8px;
        font-size: 12px;
    }
}

.campaign-header-row {
    background-color: #f8f9fa !important;
}

.campaign-header {
    padding: 10px;
    font-size: 1.1em;
    color: #2c3e50;
    border-left: 4px solid #3498db;
    margin: 0;
}

.campaign-header i {
    color: #3498db;
}

.campaign-header-row td {
    padding: 0 !important;
}

.campaign-header-row + tr td {
    padding-left: 20px;
}

/* Add some spacing between campaign groups */
.campaign-header-row:not(:first-child) {
    margin-top: 20px;
}

/* Style for contact rows */
#contactsTable tbody tr:not(.campaign-header-row) {
    transition: background-color 0.2s;
}

#contactsTable tbody tr:not(.campaign-header-row):hover {
    background-color: #f1f8ff !important;
}

/* Loading indicator */
.dataTables_processing {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    padding: 10px 20px !important;
    color: #333 !important;
    font-weight: 500 !important;
}

/* Đảm bảo dropdown-menu hiển thị trên cùng */
.dropdown-menu {
    z-index: 1055 !important;
    min-width: 180px;
    max-width: 260px;
    word-break: break-word;
}

/* Nếu dropdown vẫn bị cắt, có thể thử cho table-responsive overflow visible */
.table-responsive {
    overflow: visible !important;
}

/* Nút hành động custom */
.action-group {
    position: relative;
    display: inline-block;
}
.action-group .btn-action-toggle {
    min-width: 100px;
    font-weight: 500;
}
.action-menu {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-width: 150px;
    padding: 4px 0;
    z-index: 1100;
}
.action-menu .dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
    color: #222;
    border-radius: 0;
    transition: background 0.15s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
.action-menu .dropdown-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

/* Modern contacts page styles */
.contacts-page-modern {
    padding: 20px 0;
}

.contacts-header {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.contacts-cards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.contact-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.contact-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.contact-main {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #495057;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.contact-email, .contact-phone {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.contact-refcode {
    margin-top: 4px;
}

.refcode-badge {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    color: #495057;
}

.contact-actions {
    position: relative;
}

.btn-action-3dots {
    background: none;
    border: none;
    color: #6c757d;
    padding: 4px;
    cursor: pointer;
}

.btn-action-3dots:hover {
    color: #495057;
}

.card-action-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 8px 0;
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.action-item {
    display: block;
    width: 100%;
    padding: 8px 15px;
    border: none;
    background: none;
    text-align: left;
    color: #495057;
    cursor: pointer;
}

.action-item:hover {
    background: #f8f9fa;
}

.contact-status {
    font-size: 0.85em;
    padding: 2px 8px;
    border-radius: 12px;
}

.contact-status.pending {
    background: #fff3cd;
    color: #856404;
}

.contact-status.active {
    background: #d4edda;
    color: #155724;
}

.contact-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.contact-time {
    font-size: 0.85em;
    color: #6c757d;
}

/* Approval buttons */
.btn-group {
    display: flex;
    gap: 8px;
}

.btn-approve, .btn-reject {
    padding: 4px 12px;
    font-size: 0.9em;
}

.btn-approve {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.btn-approve:hover {
    background: #218838;
    border-color: #1e7e34;
}

.btn-reject {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.btn-reject:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Search and filter */
.input-group {
    width: auto;
}

#searchContact {
    min-width: 200px;
}

#filterStatus {
    min-width: 150px;
}

/* Modal styles */
.modal-content {
    border-radius: 8px;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 15px 20px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
}

#rejectReason {
    resize: none;
}

@media (max-width: 900px) {
    .contacts-list { flex-direction: column; gap: 12px; }
    .contact-card { max-width: 100%; min-width: 0; }
} 