/* ========== Cuentas Asignadas ========== */

.section-cuentas {
    animation: fadeIn 0.2s ease;
}

.cuentas-header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.cuentas-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.cuentas-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.cuentas-stat-dot.green { background: var(--success-color); }
.cuentas-stat-dot.red { background: var(--danger-color); }

.cuentas-stat strong {
    color: var(--text-dark);
    font-weight: 700;
}

/* ========== Two-Panel Layout ========== */

.cuentas-panels {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    min-height: 500px;
}

/* ========== Left: Employee List ========== */

.cuentas-list {
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    max-height: 70vh;
}

.cuentas-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.1s;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.cuentas-list-item:last-child {
    border-bottom: none;
}

.cuentas-list-item:hover {
    background: var(--bg-hover);
}

.cuentas-list-item.selected {
    background: rgba(59, 130, 246, 0.08);
}

.cuentas-list-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

.cl-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

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

.cl-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-count {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 1px;
}

.cl-count.has-accounts {
    color: #009ee3;
}

/* ========== Right: Account Detail ========== */

.cuentas-detail {
    display: flex;
    flex-direction: column;
}

.cuentas-detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cd-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cd-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.cd-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
}

.cd-subtitle {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.cd-add-btn {
    padding: 7px 16px;
    border: 1px solid var(--border-color);
    background: none;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cd-add-btn:hover {
    border-color: #009ee3;
    color: #009ee3;
    background: rgba(0, 158, 227, 0.04);
}

/* ========== Accounts Grid ========== */

.cd-accounts-area {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
}

.cd-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.cd-account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.15s;
}

.cd-account-card:hover {
    border-color: rgba(0, 158, 227, 0.3);
    background: rgba(0, 158, 227, 0.03);
}

.cd-mp-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #009ee3, #00b4ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

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

.cd-account-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cd-account-label {
    font-size: 10px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}

.cd-account-del {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.1s;
    flex-shrink: 0;
}

.cd-account-card:hover .cd-account-del {
    opacity: 1;
}

.cd-account-del:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* ========== Empty state ========== */

.cd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-light);
}

.cd-empty-icon {
    font-size: 36px;
    opacity: 0.2;
}

.cd-empty-text {
    font-size: 14px;
}

/* ========== No selection ========== */

.cd-no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    color: var(--text-light);
    opacity: 0.5;
}

.cd-no-selection-icon {
    font-size: 40px;
}

.cd-no-selection-text {
    font-size: 14px;
}

/* ========== Inline add ========== */

.cd-add-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.cd-add-input {
    flex: 1;
    padding: 9px 14px;
    font-size: 14px;
    background: var(--bg-white);
    border: 1px solid #009ee3;
    color: var(--text-dark);
    border-radius: 8px;
    box-shadow: 0 0 0 3px rgba(0, 158, 227, 0.08);
}

.cd-add-input:focus {
    outline: none;
}

.cd-add-input::placeholder {
    color: var(--text-light);
    opacity: 0.5;
}

.cd-act-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.15s;
}

.cd-act-btn.save {
    background: var(--success-color);
    color: #fff;
}
.cd-act-btn.save:hover { background: #059669; }

.cd-act-btn.cancel {
    background: var(--bg-hover);
    color: var(--text-light);
}
.cd-act-btn.cancel:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

@media (max-width: 768px) {
    .cuentas-panels {
        grid-template-columns: 1fr;
    }
    .cuentas-list {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
    }
}
