/* Filters Section */
.filters-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.date-input {
    color: #6b7280;
}

.btn-submit {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-submit:hover {
    background: #059669;
}

.btn-reset {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background: #059669;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.btn-focus {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-focus:hover {
    background: #e5e7eb;
}

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

/* Contacts Table */
.contacts-table-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.contacts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 1200px;
}

.contacts-table th {
    background: #f9fafb;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.contacts-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    vertical-align: top;
}

.contacts-table tbody tr:hover {
    background: #f9fafb;
}

.contacts-table tbody tr:last-child td {
    border-bottom: none;
}

.contacts-table td:nth-child(8) {
    font-size: 12px;
    line-height: 1.3;
    min-width: 140px;
}

/* Priority Badges */
.priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.priority-0 {
    background: #fee2e2;
    color: #991b1b;
}

.priority-1 {
    background: #fef3c7;
    color: #92400e;
}

.priority-2 {
    background: #dbeafe;
    color: #1e40af;
}

.priority-3 {
    background: #d1fae5;
    color: #065f46;
}

/* Status Badges */
.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-process {
    background: #dbeafe;
    color: #1e40af;
}

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

.status-lead {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.action-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #f3f4f6;
    color: #6b7280;
}

.action-btn:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-1px);
}

.action-btn.view:hover {
    background: #dbeafe;
    color: #1e40af;
}

.action-btn.edit:hover {
    background: #fef3c7;
    color: #92400e;
}

.action-btn.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .filter-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .contacts-table th,
    .contacts-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .filters-section {
        padding: 16px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .contacts-table-section {
        padding: 16px;
    }

    .contacts-table {
        min-width: 800px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 2px;
    }

    .action-btn {
        padding: 4px 6px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .filters-section,
    .contacts-table-section {
        margin: 8px;
        padding: 12px;
    }

    .filter-input,
    .filter-select,
    .btn-submit,
    .btn-reset,
    .btn-focus {
        padding: 6px 10px;
        font-size: 13px;
    }
}
/* Filter Toggle Button Styling */
.btn-filter-toggle {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter-toggle:hover {
    background: #e5e7eb;
}

/* Responsive Filter Toggle Behavior */
@media (max-width: 768px) {
    .filters-grid .filter-group {
        display: none;
    }

    .filters-grid .search-and-toggle {
        display: flex;
        flex-direction: column;
    }

    .filters-grid.show-filters .filter-group {
        display: flex;
    }

    .filters-grid.show-filters .search-and-toggle {
        display: flex;
    }
}
/* Hide all filters except .filter-always-visible on small screens */
@media (max-width: 768px) {
    .filters-grid .filter-group {
        display: none;
    }

    .filters-grid .filter-always-visible {
        display: flex;
        flex-direction: column;
    }

    .filters-grid.show-filters .filter-group {
        display: flex;
    }

    .filters-grid.show-filters .filter-always-visible {
        display: flex; /* Always visible, even when filters shown */
    }
}
.btn-filter-toggle {
    display: none; /* Hidden by default */
}

/* Show toggle button only on small screens */
@media (max-width: 768px) {
    .btn-filter-toggle {
        display: inline-block;
    }
}