/* Contacts Layout */
.contacts-container {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    height: calc(100vh - 60px);
    margin-top: 60px;
    background: #f5f8fa;
    overflow: hidden;
}

/* Left Sidebar Styles */
.contacts-sidebar {
    border-right: 1px solid #e5e8eb;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contacts-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e8eb;
    background: #f5f8fa;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-toggle {
    color: #33475b;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-wrapper input {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd6e2;
    border-radius: 3px;
    cursor: pointer;
}

.filter-btn {
    background: transparent;
    border: none;
    color: #33475b;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 3px;
}

.filter-btn:hover {
    background: #eaf0f6;
}

/* Contact List Styles */
.contact-list {
    overflow-y: auto;
    flex: 1;
}

.contact-item {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid #e5e8eb;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contact-item:hover {
    background: #f5f8fa;
}

.contact-item.active {
    background: #eaf0f6;
    border-left: 4px solid #0091ae;
    padding-left: 12px;
}

.contact-avatar {
    width: 32px;
    height: 32px;
    background: #7c98b6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    font-weight: 500;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 14px;
    color: #33475b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-date {
    font-size: 12px;
    color: #516f90;
}

/* Main Content Styles */
.contact-main {
    background: white;
    border-right: 1px solid #e5e8eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contact-header {
    padding: 20px;
    border-bottom: 1px solid #e5e8eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f8fa;
}

.contact-title h2 {
    font-size: 16px;
    color: #33475b;
    margin-bottom: 4px;
    font-weight: 600;
}

.contact-meta {
    font-size: 12px;
    color: #516f90;
}

.contact-actions {
    display: flex;
    gap: 8px;
}

.close-btn {
    background: transparent;
    border: 1px solid #cbd6e2;
    color: #33475b;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.close-btn:hover {
    background: #f5f8fa;
}

.more-btn {
    background: transparent;
    border: 1px solid #cbd6e2;
    color: #33475b;
    width: 32px;
    height: 32px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Contact Details */
.contact-details {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.details-section {
    margin-bottom: 24px;
}

.details-section h3 {
    font-size: 14px;
    color: #33475b;
    margin-bottom: 12px;
    font-weight: 600;
}

.owner-select {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #cbd6e2;
    border-radius: 3px;
    cursor: pointer;
}

.owner-select:hover {
    background: #f5f8fa;
}

.owner-select img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.owner-select span {
    color: #33475b;
    font-size: 14px;
    flex: 1;
}

/* Right Sidebar Styles */
.info-sidebar {
    background: white;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.info-header {
    padding: 20px;
    border-bottom: 1px solid #e5e8eb;
    background: #f5f8fa;
}

.info-header h3 {
    font-size: 14px;
    color: #33475b;
    font-weight: 600;
}

.info-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.info-section {
    margin-bottom: 24px;
}

.info-section label {
    display: block;
    font-size: 12px;
    color: #516f90;
    margin-bottom: 6px;
    font-weight: 500;
}

.info-section p {
    color: #33475b;
    font-size: 14px;
}

.with-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 0;
}

.with-dropdown:hover {
    color: #0091ae;
}

/* Scrollbar Styles */
.contact-list::-webkit-scrollbar,
.contact-details::-webkit-scrollbar,
.info-content::-webkit-scrollbar {
    width: 8px;
}

.contact-list::-webkit-scrollbar-track,
.contact-details::-webkit-scrollbar-track,
.info-content::-webkit-scrollbar-track {
    background: transparent;
}

.contact-list::-webkit-scrollbar-thumb,
.contact-details::-webkit-scrollbar-thumb,
.info-content::-webkit-scrollbar-thumb {
    background: #cbd6e2;
    border-radius: 4px;
}

/* Communication History */
.communication-history {
    margin-top: 24px;
    padding: 16px;
    background: #f5f8fa;
    border-radius: 4px;
    min-height: 200px;
}

/* Contacts Page Layout */
.contacts-page {
    padding: 24px;
    background: white;
}

/* Header Section */
.contacts-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.contacts-title h1 {
    font-size: 20px;
    color: #33475b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contacts-title h1 i {
    font-size: 14px;
    color: #516f90;
}

.record-count {
    color: #516f90;
    font-size: 13px;
    margin-left: 4px;
}

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.data-quality {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #cbd6e2;
    border-radius: 3px;
    background: white;
    color: #33475b;
}

.quality-score {
    background: #ff7a59;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-primary {
    background: #ff7a59;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-secondary {
    background: white;
    color: #33475b;
    border: 1px solid #cbd6e2;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
}

/* View Tabs */
.view-tabs {
    display: flex;
    border-bottom: 1px solid #cbd6e2;
    margin-bottom: 16px;
    align-items: center;
    padding: 0 4px;
}

.tab {
    padding: 8px 12px;
    color: #33475b;
    cursor: pointer;
    font-size: 13px;
    position: relative;
    margin-right: 24px;
}

.tab.active {
    color: #0091ae;
    font-weight: 500;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0091ae;
}

.tab i {
    margin-left: 8px;
    font-size: 10px;
    color: #516f90;
}

.tab-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-view {
    color: #0091ae;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

.all-views {
    color: #33475b;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

/* Filter Section */
.filter-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.filter-options {
    display: flex;
    gap: 8px;
    margin: 0;
}

.filter-btn {
    padding: 4px 8px;
    background: white;
    border: 1px solid #cbd6e2;
    border-radius: 3px;
    color: #33475b;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
}

.filter-btn i {
    font-size: 10px;
    color: #516f90;
}

.filter-btn.advanced {
    color: #0091ae;
}

.filter-btn.advanced i {
    color: #0091ae;
    margin-right: 4px;
}

.filter-actions {
    display: flex;
    gap: 4px;
}

.icon-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #cbd6e2;
    border-radius: 3px;
    background: white;
    color: #33475b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-btn:hover {
    background: #f5f8fa;
}

/* Search Bar */
.search-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.search-input-wrapper {
    position: relative;
    width: 300px;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #516f90;
    font-size: 14px;
}

.search-input-wrapper input {
    width: 100%;
    height: 36px;
    padding: 8px 12px 8px 36px;
    border: 1px solid #cbd6e2;
    border-radius: 3px;
    font-size: 14px;
    color: #33475b;
    background: white;
}

.search-input-wrapper input::placeholder {
    color: #7c98b6;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #0091ae;
    box-shadow: 0 0 0 1px #0091ae;
}

.search-actions {
    display: flex;
    gap: 8px;
}

.export-btn, .columns-btn {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #cbd6e2;
    border-radius: 3px;
    background: white;
    color: #33475b;
    font-size: 13px;
    cursor: pointer;
}

.export-btn:hover, .columns-btn:hover {
    background: #f5f8fa;
}

/* Table Styles */
.contacts-table {
    border: 1px solid #cbd6e2;
    border-radius: 4px;
    overflow: auto;
    margin-bottom: 0;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    table-layout: fixed;
}

th {
    background: #f5f8fa;
    padding: 8px 16px;
    text-align: left;
    color: #33475b;
    font-weight: 600;
    font-size: 11px;
    border-bottom: 1px solid #cbd6e2;
}

th i {
    margin-left: 4px;
    color: #516f90;
}

td {
    padding: 8px 16px;
    border-bottom: 1px solid #eaf0f6;
    color: #33475b;
    font-size: 13px;
    white-space: nowrap;
}

.owner-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    width: 24px;
    height: 24px;
    background: #7c98b6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
}

td.empty-cell {
    color: #516f90;
}

/* Table container */
.contacts-table {
    border: 1px solid #cbd6e2;
    border-radius: 4px;
    overflow: auto; /* Enable horizontal scroll if needed */
    margin-bottom: 0;
}

/* Ensure table takes full width */
table {
    width: 100%;
    min-width: 900px; /* Prevent columns from getting too narrow */
    border-collapse: collapse;
    table-layout: fixed;
}

/* Owner cell ellipsis */
.owner-cell span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 40px); /* Account for avatar */
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid #cbd6e2;
    background: #f5f8fa;
    height: 48px;
    gap: 16px;
}

.prev-btn {
    color: #516f90;
    background: none;
    border: none;
    font-size: 13px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prev-btn i {
    font-size: 10px;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-numbers button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #cbd6e2;
    background: white;
    color: #33475b;
    font-size: 13px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.page-numbers button.active {
    background: #f5f8fa;
    border-color: #cbd6e2;
    font-weight: 500;
}

.page-numbers button:last-child {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
}

.page-numbers button:last-child i {
    font-size: 10px;
}

.per-page {
    margin-left: auto;
    color: #33475b;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.per-page i {
    font-size: 10px;
    color: #516f90;
}

/* Table Column Widths */
.checkbox-col {
    width: 40px;
}

.name-col {
    width: 20%;
}

.email-col {
    width: 20%;
}

.phone-col {
    width: 15%;
}

.owner-col {
    width: 15%;
}

.status-col {
    width: 10%;
}

.date-col {
    width: 20%;
}

/* Status styles */
td:nth-child(6) {
    font-weight: 500;
}

td:nth-child(6):contains('Lead') {
    color: #ff7a59;
}

td:nth-child(6):contains('Client') {
    color: #00bda5;
}

td:nth-child(6):contains('Prospect') {
    color: #0091ae;
} 