﻿/* Company Settings Container */
.cmp-form-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form Fields */
.cmp-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.cmp-form-field.cmp-full-width {
    width: 100%;
}

.cmp-field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.cmp-form-field .btn-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: black;
    background: white;
    border: 1px solid #d1d1d1;
    padding: 0.625rem 0.75rem;
}

.cmp-form-field .btn-filter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Input Styles */
.cmp-text-input,
.cmp-date-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #111827;
    outline: none;
    transition: all 0.2s;
}

.cmp-text-input::placeholder {
    color: #9ca3af;
}

.cmp-text-input:focus,
.cmp-date-input:focus {
    border-color: #7fad49;
    ring: 1px solid #7fad49;
}

.cmp-text-input:disabled,
.cmp-date-input:disabled {
    background-color: #f9fafb;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Checkbox Styles */
.cmp-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.cmp-checkbox-group.cmp-segment-options {
    margin-top: 1rem;
}

.cmp-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.cmp-checkbox-wrapper input[type=checkbox]:checked+label {
    background: transparent;
}

.cmp-checkbox {
    visibility: visible !important;
    width: 1rem !important;
    height: 1rem !important;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
    accent-color: #7fad49;
}

.cmp-checkbox:focus {
    outline: none;
    outline-offset: 2px;
}

.cmp-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.cmp-checkbox-label {
    font-size: 0.875rem;
    color: #374151;
    user-select: none;
}

.cmp-checkbox-wrapper:hover .cmp-checkbox-label {
    color: #111827;
}

.cmp-date-group,
.cmp-commission-grid,
.cmp-segment-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.contacts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    font: normal normal 500 var(--s-14);
    margin-top: var(--px-12);
    table-layout: fixed;
}

.contacts-table .table-header-row th:nth-child(1) {
    width: 15%;
}

/* Name */
.contacts-table .table-header-row th:nth-child(2) {
    width: 12%;
}

/* Position */
.contacts-table .table-header-row th:nth-child(3) {
    width: 18%;
}

/* Mail */
.contacts-table .table-header-row th:nth-child(4) {
    width: 12%;
}

/* Mobile */
.contacts-table .table-header-row th:nth-child(5) {
    width: 12%;
}

/* Tel */
.contacts-table .table-header-row th:nth-child(6) {
    width: 20%;
}

/* Notes */
.contacts-table .table-header-row th:nth-child(7) {
    width: 11%;
}

/* Actions */

/* Thêm styles cho contact edit row TRƯỚC @media (max-width: 768px) */
.contact-edit-row .table-cell {
    padding: 8px 12px;
    vertical-align: middle;
}

.contact-edit-row .form-control-p {
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #111827;
    background-color: #ffffff;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.contact-edit-row .form-control-p:focus {
    border-color: #7fad49;
    box-shadow: 0 0 0 2px rgba(127, 173, 73, 0.1);
}

.contact-edit-row .form-control-p::placeholder {
    color: #9ca3af;
    font-size: 12px;
}

.contact-edit-row .name-cell .form-control-p {
    font-weight: 500;
}

.contacts-table thead {
    background-color: #f9fafb;
}

.contacts-table .table-header-row th {
    padding: 14px 16px;
    text-align: left;
    font: normal normal 600 var(--s-14);
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.contacts-table tbody tr {
    transition: background-color 0.2s ease;
}

.contacts-table td {
    padding: var(--px-12) var(--px-16);
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    vertical-align: middle;
}

.contacts-table tbody tr:last-child td {
    border-bottom: none;
}

.contacts-table tbody tr:last-child td .table-actions .action-btn.delete {
    background: white;
    color: black;
    height: auto;
}

.contacts-table th:last-child,
.contacts-table td:last-child {
    text-align: center;
    width: 120px;
}

.contacts-table td:nth-child(6) {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .contacts-table {
        font-size: 13px;
    }

    .contacts-table th,
    .contacts-table td {
        padding: var(--px-12);
    }

    .contacts-table th:nth-child(6),
    .contacts-table td:nth-child(6) {
        display: none;
    }
}

@media (min-width: 640px) {

    .cmp-date-group,
    .cmp-commission-grid,
    .cmp-segment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .cmp-checkbox-group {
        gap: 1.5rem;
    }
}

@media (max-width: 639px) {
    .cmp-form-container {
        gap: 1rem;
    }
}